Boolean datatype
- Boolean(10 > 9);// returns true
- (10 > 9) // also returns true
- With "REAL" or "static" value returns "false"
- var x = 0;Boolean(x);// returns false
- var x =-0;Boolean(x);// returns false
- var x ="";Boolean(x);// returns false
- var x;Boolean(x);// returns false
- var x =null;Boolean(x);// returns false
- var x =false;Boolean(x);// returns false
- var x =10/"H";Boolean(x);// returns false
- var x = false;var y = new Boolean(false);
// typeof x returns boolean // typeof y returns object
- var x = false;var y = new Boolean(false);
- (x == y) is true because x and y have equal values
- (x === y) is false because x and y have equal values
- var x = new Boolean(false);
var y = new Boolean(false); - (x == y) is false since x and y are 2 different objects
-------------------------------------------
No comments:
Post a Comment