EDIT: As contestants seem to get confused with the question, I will change it to be clearer. NEW QUESTION: A BUG CAUSES THE FUNCTION TO FAIL. SPOT THE BUG/S AND PROVIDE THE EXPECTED OUTPUT AFTER THE BUG IS FIXED. With this changes I am allowing @walnut1 , @seyiodus and @codingdefined to edit their comments once. :)
DAY 1
If you don't know what this is then click here.
How to Join?
- Upvote this post.
- Satisfy the requirements being asked for and comment it down below (either list the bugs found or provide the correct block of code).
- Only one entry per account, Once you post it you can no longer edit it.
- Don't forget the random quote w/ author!
What do you get?
TWO who get the correct answer. Prizes vary per contest so watch out.For this particular day you can get 10 Whaleshares courtesy of @akrid for the first
Happy Hunting and Good Luck!
Question: A bug causes the function to fail, spot the bug and provide the expected output.
NEW QUESTION: A BUG CAUSES THE FUNCTION TO FAIL. SPOT THE BUG/S AND PROVIDE THE EXPECTED OUTPUT AFTER THE BUG IS FIXED.
-- start --
function bug_hunting () {
for (var x=1; x <=5 ; x+=)
if (x === 0) { console.log(x + " is zero"); }
elseif (x % 2 === 0) { consle.log(x + " even");
else { console.log(x + " is odd"); }
}
}
bug_hunting();
-- end --
Contestants must also have or be willing to make a bitshares account to claim prizes, if you don't have one yet you can make on here
Come join us on Whaleshares Discord: https://discordapp.com/invite/qDUmmPC . Come chat with me!! :D
That's it for now, see you guys in the next one, keep your eyes open and Gotta Catch 'Em All!!!
Follow @contests for all kinds of Whaleshares contests!
this.A HUGE THANK YOU to @officialfuzzy, @blocktrades and @akrid for making this contest possible. If you don't know what Whaleshares are or want to learn more about Whaleshares click
These are the bugs.
"elseif"
instead of "else if"
"{ consle.log(x + " even");"
There is no curly base at the end.
"else"
There is no 'if' there.
expected output.
for (var x=1; x <=5 ; x+=) if (x === 0) { console.log(x + " is zero"); } else if (x % 2 === 0) { consle.log(x + " even"); } else if { console.log(x + " is odd"); } }
"People are mostly focused on defending the computers on the Internet, and there's been surprisingly little attention to defending the Internet itself as a communications medium." - W. Daniel Hillis
hello @seyiodus, I did a edit with the question as I understand that it seems a little confusing. You can edit your answer once. Good Luck!
Nice post
thanks :) you should join in!
X+=6
This post has received a 9.39 % upvote from @buildawhale thanks to: @jepu. Send at least 1 SBD to @buildawhale with a post link in the memo field for a portion of the next vote.
Steem WitnessTo support our daily curation initiative, please vote on my owner, @themarkymark, as a
STEEM WitnessYou got a 5.15% upvote from @upme requested by: @jepu. Send at least 1 SBD to @upme with a post link in the memo field to receive upvote next round. To support our activity, please vote for my master @suggeelson, as a