可能重複:
Workarounds for JavaScript parseInt octal bug怪異intParse行爲
鑑於此腳本:
<script type="text/javascript">
var noproblem07 = parseInt("07") - 1;
alert("No problem (07): " + noproblem07);
var problem08 = parseInt("08") - 1;
alert("Problem (08): " + problem08);
var problem09 = parseInt("09") - 1;
alert("Problem (09): " + problem09);
var noproblem10 = parseInt("10") - 1;
alert("No problem (10): " + noproblem10);
</script>
爲什麼 「08」 和 「09」 的決心爲-1?
是指第二個參數爲[parseInt函數(https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/ parseInt) – Yoshi 2012-08-06 18:02:27
爲什麼你減1? – Bergi 2012-08-06 18:03:41