gpt4 book ai didi

javascript - 为什么 2..toString() 有效?

转载 作者:数据小太阳 更新时间:2023-10-29 04:01:33 24 4
gpt4 key购买 nike

<分区>

为什么 2..toString() 返回 22.toString() 抛出此错误?

例子:

console.log(2..toString()); // prints 2

// Firefox throws the error
// `SyntaxError: identifier starts immediately after numeric literal`
console.log(2.toString());

var x = 2;
console.log(x.toString()); // prints 2

// Firefox throws the error
//`TypeError: XML descendants internal method called on incompatible Number`
console.log(x..toString());

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com