Use the below code:(使用以下代码:)
function isOdd(num) { return num % 2;} console.log("1 is " + isOdd(1)); console.log("2 is " + isOdd(2)); console.log("3 is " + isOdd(3)); console.log("4 is " + isOdd(4));
1 represents an odd number, while 0 represents an even number.(1代表奇数,0代表偶数。) 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…