JavaScript 中的 Number.parseInt() 函数
htmljavascriptprogramming scripts更新于 2024/10/13 11:56:17
Number 对象的 parseInt() 函数接受一个字符串,解析并返回指定基数或基数的整数。
语法
其语法如下
Number.parseInt('0xF', 16);
示例
<html>
<head>
<title>JavaScript 示例</title>
</head>
<body>
<script type="text/javascript">
var result = Number.parseInt('0xF', 16);
document.write(result);
</script>
</body>
</html>
输出
15
相关文章
有用资源
html 参考教程 - 该教程包含有关 html 的更多信息:https://www.cainiaomax.com/html/

