Boolean number
number:0,1.2,0377 octal. 0xFF binary Infinity Infinity (10/0), exponential (scientific notation)
Infinity * 0==nan
Infinity + Infinity = Infinity
infinity-infinity = Infinity;
-infinity + Infinity = Infinity;
Infinity *10 = Infinity;
A few important ways
--parseint/parsefloat/tofixed () returns the number
The method of judging whether it is a number: IsNaN, if the number (string number) is False
Alert (IsNaN (document.getElementById ("text"). value));
parseint ("12SDFSD");//12
When rejecting PX: parseint ("10px") ==10
var boxdom = document.getElementById ("box");
var width =parseint (boxDom.style.width);//100
var height =parseint (boxDom.style.height);//100
ToFixed applies To: When a progress bar intercepts decimals, rounding
boolean--condition judgment if ElseIf else
Falsy:
var flag;//0 number null undefined "" False all False (false)
For example: var text = document.getElementById ("T"). Value;
if (!text) {alert ("Please enter a value and get Focus"); return;}
var a = "100";
if (a) ==a=true
var a = "0";
if (a) a= true; Because the value of the element obtained from the form form is a string, if you do not understand it, use TypeOf to print the data type as much as possible. In the development phase try not to understand the multi-debug and alert
Often in the process of debugging we, we write a lot of logic when we can use the Return key organization code to execute down until the debug succeeds in the return to clear out.
Logical judgment: or (| |) and (&&) non (!)
Non, True and False, False also true for example:!false = TRUE//!true= false;
Or: One is good (true), all are good, return all are bad people are bad people such as: true | | False | | True ==true
And: A bad guy is all bad guys. False && true && true, Result: false. Return True&&true&&true =true
Often in development, it is often enclosed in parentheses to execute your own business logic, which is a priority
For example: true | | (True && false) ==true
true | | True ==true
Note Dot: + is the connection character Doom
For example: var a = 10; var B = "Ten"; var C = a+parseint (b);//20
Note: Eval has the ability to compute,
Logical judgment of JavaScript and the knowledge point of the loop