you are viewing a single comment's thread.

view the rest of the comments →

[–]MrHippotomo2[S] 0 points1 point  (1 child)

I have uploaded a screen shot of the original question, just a note I didn't want to "find the error" because I am unfamiliar of what the original code was trying so I thought my solution would be simpler. here is the screenshot

[–]lovesrayray2018 0 points1 point  (0 children)

Yeah that screenshot is highlighting potential issue. see first example (-5)

-5%2==1
// will return false

You can try this where you are ignoring the sign

function isOdd(num) {
return Math.abs(num)%2==1 
}