8-When to 'while' and when to 'for'


#1

Can someone help and explain to me where i am wrong with this syntax
var one = 1;
var once=function();
while(one = 1);{
console.log("good");}
one++;
for(var i = 1; i < 11; i++);
{console.log(i);}


#2

adding too many semi-colons can cause a lot of problems:

var once=function(); // unnecessary semi-colon
while(one = 1); // unnecessary semi-colon
for(var i = 1; i < 11; i++); // unnecessary semi-colon

and take a look at function syntax:

var once = function(){

}

the curly brackets are missing in your coase


#3

Thanks i made it with you're advice.


#4