You are viewing a single comment's thread from:
RE: A WILD BUG APPEARED! - WHALESHARES UP FOR GRABS!!
Bugs:
- you probably wanted to start with
x=0
since you referenced that in the code - start the
for
with{
x++
instead ofx+=
else if
instead ofelseif
- added missing
}
console
instead ofconsle
function bug_hunting () {
for (var x=0; x <= 5 ; x++) {
if (x === 0) { console.log(x + " is zero"); }
else if (x % 2 === 0) { console.log(x + " is even"); }
else { console.log(x + " is odd"); }
}
}
bug_hunting();
and the output:
0 is zero
1 is odd
2 is even
3 is odd
4 is even
5 is odd
close one, but as you can see in the question
var x = 1
and not equals to0
also you've forgotten the random quote. Thanks for joining and good luck next time!