Boolean can be said to be the simplest type. I encountered some problems when using only the true and false values. Note: 1. newBoolean (false) Example 1: viewplaincopytoclipboardprint? 1. varexistsnewBoolean (false); 2. alert (exists? True: false );
Boolean can be said to be the simplest type. I encountered some problems when using only the true and false values. Note: 1. new Boolean (false) Example 1: view plain copy to clipboard print? 1. var exists = new Boolean (false); 2. alert (exists? 'True': 'false ');
Boolean is the simplest type, with only true and false values.
I encountered some problems during use. Note the following:
1,NewBoolean (False)
Example 1:
View plaincopy to clipboardprint?
1. var exists = new Boolean (false );
2. alert (exists? 'True': 'false ');
Var exists = new Boolean (false); alert (exists? 'True': 'false ');
The code above is shown :'True', That is, new Boolean (false) is true in condition judgment!
According to the information, the condition for determining the Boolean type is as follows:
1. All objects are considered to beTrue.
2. the string is considered to beFalse.
3. null and undefined are considered to beFalse.
4. if and only if the value is zeroFalse.
Well, now I understand,Typeof newBoolean (False) = 'Object', which is an object type. The first object based on the judgment condition isTrue
2. $ ('button1'). disabled = 'false'; invalid
Example 2:
View plaincopy to clipboardprint?
1. this. disabled = 'false ';
This. disabled = 'false ';
Example 3:
View plaincopy to clipboardprint?
1. this. disabled = false;
This. disabled = false;
Like above, 'false' is actuallyTrueThe second "string is considered to beFalse
SetTimeout ("submits ()", 5000); // latency Processing
SetInterval ("submits ()", 5000); // loop Processing
Original address:
Http://blog.csdn.net/zswang/archive/2009/02/24/3932586.aspx