简体   繁体   中英

Node.js Object function Number() { [native code] } has no method 'isInteger'

Some methods and fields are missing from Node.js 'Number' class. For instance,

console.log(Number.isInteger(5));

Gives, "TypeError: Object function Number() { [native code] } has no method 'isInteger'", while

console.log(Number.isFinite(5));

runs fine.

Similarly,

console.log(Number.MAX_SAFE_INTEGER);

returns 'undefined', while

console.log(Number.MAX_VALUE);

returns '1.7976931348623157e+308' as expected.

What is the issue? Mozilla Javascript network says all above methods should work fine.

安装最新版本的Node.js可以解决此问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM