[js] — learning
Fire up console and question these:
5 - "4" // 1
5 + "4" // 54
+!{}[true]
+[1]
+[1,2]
7 - "a"
7 / 0
5 + "4"
5 + null
4 == "4.00"
null == undefined
0 == false
0 == null
null == false
typeof null == "object" // should be null
typeof function() {} == "function" // should be object
Not all things in JS in an object. Know the difference.
var a = "string";
alert(a.length); // 6
a.t = 3
alert(a.t); // undefined
has 3 phases.
function add(a) {
return function (b) {
return a + b;
};
add(3)(4) == 7