JS: Number.isInteger

By Xah Lee. Date: . Last updated: .
Number.isInteger(number)
Return true if number is a integer.
console.log( Number.isInteger( 0 ) );
console.log( Number.isInteger( 0.0000 ) );
console.log( Number.isInteger( new Number (3).valueOf() ) );
console.log( Number.isInteger( new Number (3) ) === false);
console.log( Number.isInteger( 0.00000000000000001 ) === false );
console.log( Number.isInteger( Infinity ) === false );
console.log( Number.isInteger( NaN ) === false );
// all true