Skip to content

r-hooss/is-odd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

is-odd

is-odd for deno
Reference : https://github.com/i-voted-for-trump/is-odd/

how to use

import { isOdd } from "https://deno.land/x/is_odd/index.ts";

console.log(isOdd("1")); // true
console.log(isOdd("2")); // false
console.log(isOdd("3")); // true

console.log(isOdd(4)); // false
console.log(isOdd(5)); // true
console.log(isOdd(6)); // false

console.log(isOdd(-1)); // true
console.log(isOdd("-2")); // false

console.log(isOdd("owo")); // RangeError: expected an integer
console.log(isOdd(9007199254740992)); // RangeError: value exceeds maximum safe integer