The Tips about Javascript That Virtually No One Knows About

Type of NaN is “number”
> typeof NaN
> "number"
You can modify the ‘console’ object
console._log = console.log;
console.log = function () {
console._log('logging...');
console._log.apply(null, arguments);
}
>console.log('test');
logging...
test
You can use unicode strings and egyptian hieroglyphs as variable names
let 𓀐𓅵𓀵𓁸𓃦 = "𓃂𓉤𓆣";
var ಠ_ಠ = function(){ console.log("Hello there"); }
Performance Tracking of functions
Use Performance.now() which is more accurate than console.time and console.timeEnd
start = performance.now();
foo();
stop = performance.now();
console.log("foo took " + (stop - start) + " milliseconds");
Object destructuring in ES6
// old
var username = req.body.username;
var password = req.body.password;
// ES6
var { username, password } = req.body;
Number Type coercion
> parseInt("5") + 2
7
> +"5" + 2
7
Find more on /r/ProgrammerTIL