/* In the Basic JS syntax, there are several confusing points. */ /* ===== */ Function De (){ VaR AB = 25; // Value VaR BA = "25 "; // String If (AB = BA ){// =, Which is converted first and then compared. // Alert ("B "); } If (! (AB = BA )){ // ===Without conversion, direct comparison is performed. AB is a numerical data, while Ba is a string data. // Alert (""); }} /* ! B !! B */ Function Dd (){ VaR B = 1 ; If (!! B ){ // ! It is not 0, so false is returned. When !! Then, the Boolean () method is further involved, and then the inverse of the Boolean value is obtained. // Alert (""); }} /* Parseint parsefloat */ Function Parse (){ VaR A = "18px" ; VaR B = parseint (); // Return Value 18 VaR C = parseint (A, 10 ); // Returns the value 18. You can pass the parameter in hexadecimal notation. // Alert (B ); Alert (C ); VaR E = "18.2px" ; VaR D =Parsefloat (E); alert (d) /* The difference between parseint and parsefloat is that the first decimal point is not ignored when parsefloat is converted. That is to say, the number after the first decimal point is retained, but the second decimal point is ignored. Parsefloat also ignores the 0 at the first position. */ } Window. onload = Function () {Parse (); dd (); De ();}