I ran into a problem when trying to define an array inside of Fire array (seen in code).
I used console.log() to output array length which is inside of my Fire[] array (as a debug) but got an error saying that said array was undefined. Here's my code:
var Fire = [];
var fire = function FireGen()
{
this.particle = [];
var part = function Particle()
{
};
this.particle.push(part);
};
Fire.push(fire);
console.log(Fire.particle.length); //Outputs undefined
I'm quite new when it comes to object and array usage in JavaScript. I would appreciate if someone could explain why my array is undefined.