Odd or even number
Write a JavaScript function to accept a number. Determine if the given number is odd or even.
Sample Code:
function oddOrEven(n1) {
// Enter your logic here...
}
Examples:
Input: 10
Output: 'even'
Explanation: 10 is an even number, therefore the function returned 'even' string.
Input: 1
Output: 'odd'
Explanation: 1 is an odd number, therefore the function returned 'odd' string.