Specify their values
1. typeof (NaN), typeof (Infinity), typeof (null), typeof (undefined)
2. NaN = NaN
3. NaN! = NaN
4. NaN> = NaN
5. null = undefined
6. null> = undefined
7. null <= undefined
8. parseInt ("123abc ")
9. "123abc"-0
10. Infinity> 10
11. Infinity> "abc"
12. Infinity = NaN
13. true = 1
14. new String ("abc") = "abc"
15. new String ("abc") = "abc"
Output results
1,
Var a = "123abc ";
Alert (typeof (a ++ ));
Alert ();
2,
Var a = "123abc ";
A. valueOf = function () {return parseInt ();}
Alert (++ );
Alert (a-0 );
3,
Var a = new Object ();
A. toString = function () {return "123abc ";}
A. valueOf = function () {return parseInt ();}
Alert (++ );
Alert (a-0 );
4,
String. prototype. valueOf = function ()
{
Return parseFloat (this );
}
Alert ("123abc"> 122 );
Alert (new String ("Fig")> 122 );
5,
Var s = new String ("abc ");
Alert (typeof (s) = typeof ("abc "));
Alert (s = "abc ");
Alert (s. toString () = s );
6,
Var a = new Object ();
A. toString = function () {return ""};
Var B = new Object ();
B. toString = function () {return "B "};
Alert (a> B );
A. valueOf = function () {return 1 };
B. valueOf = function () {return 0 };
Alert (a> B );
7,
Function step ()
{
Return function (x)
{
Return x + a ++;
}
}
Var a = step (10 );
Var B = step (20 );
Alert (a (10 ));
Alert (B (10 ));