float 是数字的近似值。
12345678901234567890 === 12345678901234567891
为 true
同时
1234567890 === 1234567891
为 false
num === num+1
的断点是什么?
我编写了这段代码来找出它,但它花了太长时间......
for(var i = 0;;){
var old = i;
if(++i === old) break;
}
console.log(i);
最佳答案
断点为 253。
console.log(9007199254740992 === 9007199254740993);
# true
console.log(9007199254740991 === 9007199254740992);
# false
关于javascript - float : Breakpoint when increasing by 1 does nothing,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24133786/