Bugs:
- you probably wanted to start with
x=0since you referenced that in the code - start the
forwith{ x++instead ofx+=else ifinstead ofelseif- added missing
} consoleinstead 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 = 1and not equals to0also you've forgotten the random quote. Thanks for joining and good luck next time!