Advertisement
Guest User

Untitled

a guest
Sep 25th, 2016
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. function oddEven(input) {
  2. let num = Number(input[0])
  3. if (num % 2 == 0 && num % 1 == 0)
  4. console.log("even")
  5. else if (num % 2 != 0 && num % 1 == 0)
  6. console.log("odd")
  7. if (num % 1 != 0)
  8. console.log("invalid")
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement