JavaScript can be mysterious and weird, let's just all admit that. In this talk, we'll explore all the wonderful obscure, weird bits of JavaScript, and how to befriend them so they don't bite you in the ass (if they haven't already). For example we'll explore things like:
foo();
function foo(){
console.log('foo');
}
...but this doesn't?
foo(); // throws TypeError: foo is not a function
var foo = function(){
console.log('foo');
}
for(var i = 0; i < 4; i++){
setTimeout(function(){
console.log(i);
}, 0)
}
// expected 0, 1, 2, 3
// but outputs 4, 4, 4, 4???
> null == true
false
> null == false
false // wtf?
Bring your laptop for fun play-along, or just kick back and relax. Feel free to bring along your favourite JavaScript problems and we'll work on them!
p/s: Required watching for more fun JavaScript weirdness: https://www.destroyallsoftware.com/talks/wat