Added isOdd function. (#454)

* Added isOdd function.


Co-authored-by: vinayak <itssvinayak@gmail.com>
This commit is contained in:
Jake Gerber
2020-10-12 00:47:08 -07:00
committed by GitHub
parent 8af29b9edd
commit c3da503a96

13
Maths/isOdd.js Normal file
View File

@ -0,0 +1,13 @@
/*
* 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))