eval(50).toFixed(2)>eval(100).toFixed(2)
true
被当成字符串处理了??
eval(50).toFixed(2)>eval(100).toFixed(2)
true
被当成字符串处理了??
1
CosWind Aug 4, 2015 toFixed返回的是string,可以用typeof看一下
|
2
an168bang521 Aug 4, 2015 var a=eval("50"),
b= a.toFixed(2); c=parseInt(b); console.log(typeof a);//number console.log(typeof b);//string console.log(typeof c);//number console.log(eval(50).toFixed(2)>eval(100).toFixed(2));//true console.log(parseInt(eval(50).toFixed(2))>parseInt(eval(100).toFixed(2)));//false |
3
an168bang521 Aug 4, 2015 b= a.toFixed(2), 后面是逗号,不是分号;楼主可以把一个一个的输出来看看;
|
4
liking09 Aug 4, 2015 via Android
test
|
5
liking09 Aug 4, 2015 via Android
teat
|