Node.js/parseInt:修订间差异
来自康健生活
创建页面,内容为“== 引言 == <blockquote><pre> parseInt(string, radix)</pre></blockquote> == 示例 == {{Leftrightflex|<syntaxhighlight lang="javascript"> parseInt("bc",16); //表…” |
|||
| 第5行: | 第5行: | ||
{{Leftrightflex|<syntaxhighlight lang="javascript"> | {{Leftrightflex|<syntaxhighlight lang="javascript"> | ||
parseInt("bc",16); // | parseInt("bc",16); //表示把字符串 bc 转换为 16 进制 | ||
parseInt("10",8); // | parseInt("10",8); //表示把字符串 10 转换为 8 进制 | ||
parseInt("10",2); // | parseInt("10",2); //表示把字符串 10 转换为 2 进制 | ||
</syntaxhighlight>|{{consoleout|<pre> | </syntaxhighlight>|{{consoleout|<pre> | ||
188 | |||
8 | |||
2 | |||
</pre>}}}} | </pre>}}}} | ||