javascript number literal using exponent
问题 console.log(2E-12); // returns 2E-12 console.log(2E12); // returns 2000000000000 Why does line one return 2E-12 and not the same as line two. Is this an illegal way of using the exponent? 回答1: From the ECMAScript specification of toString applied to the Number type: 7. If 0 < n ≤ 21, return the String consisting of the most significant n digits of the decimal representation of s, followed by a decimal point ‘.’, followed by the remaining k−n digits of the decimal representation of s. 8. If −6