mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-14 18:03:53 +08:00
14 lines
202 B
JavaScript
14 lines
202 B
JavaScript
/*
|
|
* function to check if number is odd
|
|
* return true if number is odd
|
|
* else false
|
|
*/
|
|
|
|
const isOdd = (value) => {
|
|
return !!((value & 1))
|
|
}
|
|
|
|
// testing
|
|
console.log(isOdd(2))
|
|
console.log(isOdd(3))
|