Mafinar Rashid Khan
Product Manager
Panacea Systems Ltd
@mafinar
[] == ![]
typeof(null) == 'object'
typeof(NaN) === 'number'
NaN !== NaN
Number({}) != Number([])
1.toFixed(2) //Say what?
1 . toFixed(2) // '1.00'
1 .toFixed(2) // '1.00'
[,,] //= [undefined, undefined, undefined]
undefined + "HELLO" === 'undefinedHELLO'
[,,].join() //= ','
// Even in JS logic, should it not be
// 'undefined,undefined' ???
// By the way, this is totally valid...
undefined = "Mafinar Khan"
// :D it's not a keyword.
var nums = [1, 2, 3]
nums.splice(nums.indexOf('wtf'), 1)
nums; // [1, 2]
parseInt('F***', 16) // 15
typeof + "WTF" // Number
"10" + 10 //== "1010"
"10" * 10 //== 100
o1 = { hello: “world” };
o2 = Object.create(null);
o2.hello = “world”;
o1 + “”; // “[object Object]”
o2 + “”; // TypeError!
s = Symbol(“that’s cool”);
s; // Symbol(that’s cool)
String(s); // "Symbol(that’s cool)”
s + “”; // TypeError!
function foo() {
try {
return 2;
}
finally {
return 3;
}
}