You are viewing a single comment's thread from:

RE: A WILD BUG APPEARED! - WHALESHARES UP FOR GRABS!!

in #contest7 years ago (edited)

Bugs:

  • you probably wanted to start with x=0since you referenced that in the code
  • start the for with {
  • x++ instead of x+=
  • else if instead of elseif
  • added missing }
  • console instead of consle
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
Sort:  

close one, but as you can see in the question var x = 1 and not equals to 0 also you've forgotten the random quote. Thanks for joining and good luck next time!

Coin Marketplace

STEEM 0.16
TRX 0.15
JST 0.027
BTC 60256.67
ETH 2327.64
USDT 1.00
SBD 2.46