简体   繁体   English

Node.js对象函数Number(){[native code]}没有方法'isInteger'

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

Some methods and fields are missing from Node.js 'Number' class. Node.js“数字”类缺少某些方法和字段。 For instance, 例如,

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

Gives, "TypeError: Object function Number() { [native code] } has no method 'isInteger'", while 给出“ TypeError:对象函数Number(){[native code]}没有方法'isInteger'”,而

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. 按预期返回'1.7976931348623157e + 308'。

What is the issue? 有什么问题 Mozilla Javascript network says all above methods should work fine. Mozilla Javascript网络表示,上述所有方法都可以正常工作。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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