gpt4 book ai didi

javascript - 为什么像 `toString` 这样的方法需要在数字后加两个点?

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

<分区>

42..toString().. 背后的逻辑是什么?

双点有效并返回字符串 "42",而带有单点的 42.toString() 失败。

同样,带有三个点的 42...toString() 也会失败。

谁能解释这种行为?

console.log(42..toString());

console.log(42.toString());

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