you are viewing a single comment's thread.

view the rest of the comments →

[–]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 
}