Check my code: what is wrong?


#1

I started off wanting to use some mathematical equations from a while ago in my loops, to mix things up and keep that fresh. But it didn't work. And so now I am trying to follow the previous patterns of what we have done as closely as possible (var Choppa=true), etc. However, it is still not working. So now it is neither creative and interesting nor functional. What am I not getting?

TIA!

// Write your code below!
var honky=["Pigs", "can", "fly", "sometimes", "!"];

for(var i=1;i<3;i++){console.log(honky[i]);}

var bullhonky=function(){
var bull=true;
while(bull){
console.log("So there!);
bull=false;
};
};

bullhonky();

var timing=function(){
var tech=true;
do{
console.log("People fly, too.");
}
while(tech=false);
};

timing();


#2

@granolag,
The Instructions:
To finish up and prove your loop mastery,
write three syntactically correct loops in the editor:
one for-loop (array's start at zero and end at array.length),
one while-loop (you done Ok ),
and one do-while-loop. (The condition should be a =comparison= like (tech==false) but you use the assignment oparator = )

the for-loop:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for

the while-loop:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/while

the do-while-loop:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/do...while

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators