var a = 100;
var b = 100.00;
var c = a===b ? "a恒等于b" : "a不恒等于b";
var d = a==b ? "a等于b" : "a不等于b";
document.write(a+"
");
document.write(b+"
");
document.write(c+"
");
document.write(d+"
");
//outputs:
100
100
a恒等于b
a等于b
这说明在javascript中整型100和浮点型100.00是相等的并且还是恒等的。输出时都是100.