<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>演示JS中关系运算的细节</title> </head> <body> <script type="text/javascript"> var str = "55"; var num = 55; alert(str == num); //true alert(str === num); //false alert(str.equals(num)); //报错 </script> </body> </html>