27/33 Loop The Loop is making me loopy!


// Our Person constructor
function Person (name, age) {
this.name = name;
this.age = age;
// Now we can make an array of people
var family = new Array();
family[0] = new Person("alice", 40);
family[1] = new Person("bob", 42);
family[2] = new Person("michelle", 8);
family[3] = new Person("timmy", 6);

// loop through our new array
for(var i = 0, i <= family.length, i++) {
console.log("My name is " + family[i].name);

// never mind, i found the problem. I should've used semi-colons inside my for loop


Maybe you could have closed your Post as solution-found....


leonhard_wettengmx_n - I sincerely apologise. I did look for a way to close the post but there was no control to do so? the only controls are to share, flag, edit, or bookmark? Again. apologies.


I found my problem. So I am deleting zhis post.


Your post helped me solve my problem, especially the following line:



If they close their post then people who have the same problem have to ask again instead of just looking up the answer.


If the Post is marked as Solved === closed
it will be archived (not yet activated ??) .....

In the search-facilty
you could then use
"family[0]" status:closed
"function Person" status:open


for(var i = 0, i <= family.length, i++)

the correct is
for(var i = 0; i <= family.length; i++)