Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function oddEven(input) {
- let num = Number(input[0])
- if (num % 2 == 0 && num % 1 == 0)
- console.log("even")
- else if (num % 2 != 0 && num % 1 == 0)
- console.log("odd")
- if (num % 1 != 0)
- console.log("invalid")
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement