Number.parseInt()
Number.parseInt() 静态方法解析字符串参数并返回指定基数或基数的整数。
¥The Number.parseInt() static method parses a string argument and
returns an integer of the specified radix or base.
Try it
语法
参数
返回值
示例
Number.parseInt 与 parseInt
¥Number.parseInt vs. parseInt
该方法与全局 parseInt() 函数具有相同的功能:
¥This method has the same functionality as the global parseInt() function:
js
Number.parseInt === parseInt; // true
其目的是全局变量的模块化。请参阅 parseInt() 了解更多详细信息和示例。
¥Its purpose is modularization of globals. Please see
parseInt() for more detail and examples.
规范
| Specification |
|---|
| ECMAScript Language Specification # sec-number.parseint |
浏览器兼容性
BCD tables only load in the browser