JS nawet lub
function isEven(n) {
return n % 2 == 0;
}
function isOdd(n) {
return Math.abs(n % 2) == 1;
}
Hafez
function isEven(n) {
return n % 2 == 0;
}
function isOdd(n) {
return Math.abs(n % 2) == 1;
}
function isEven(numbers) {
if (numbers % 2 == 0) {
return true;
}
return false;
}
var input = 22;
var result = isEven(input);
console.log(result)
//Outpur: true
for(let count =0; count<=100;count++){
count%2==0? console.log(`${count} is even`):console.log(`${count} is odd`);
;
}
const isEven = (num) => num % 2 === 0;
console.log(isEven(5));// falseconsole.log(isEven(4));// true
const OddorEven = (num)=>num&1?"odd":"even";
let isEven = (n) => !(n&1);