Common type conversions in JS (General cast): 1. Force conversion to Integer:parseint; notation: x = parseint (x);
2. The forced conversion bit is:parsefloat; notation: x = parsefloat (x);
3. Detection type: x = parseint(x); Alert (typeof (True));
The commonly used operator expression in JS: 1. Logical operator (Boolean):&& and; | | or;! Non-
2. Comparison operator: = = (equals);! = (not equal to); >;<; >= (greater than or equal to); <= (less than equals);
3. Mathematical operators: +;-; *;/;% (take-over); + =; + +;
4. Other operators: concatenation of strings (numbers and strings); For example: var s1 = "Hello";
var s2 = "Lucy";
var s = s1+s2;
alert (s);
Ternary operator: var x = judging condition? value 1; value 2; For example: A==b? " A equals B ":" A is not equal to B ";
About common type conversions and operator expressions involved in JS