JavaScript/数字与字符串:修订间差异
来自康健生活
| 第3行: | 第3行: | ||
{{Leftrightflex|<syntaxhighlight lang="javascript"> | {{Leftrightflex|<syntaxhighlight lang="javascript"> | ||
Math.random() * 2 + 1 | Math.random() * 2 + 1 | ||
(Math.random() * 2 + 1)+'' | (Math.random() * 2 + 1) + '' | ||
Math.random() * 2 + 1+'' | Math.random() * 2 + 1 + '' | ||
</syntaxhighlight>|{{Consoleout|<pre> | </syntaxhighlight>|{{Consoleout|<pre> | ||
2.7966287720083733 | 2.7966287720083733 | ||