var functionName = function() {} vs function functionName() {}

The difference is that functionOne is a function expression and so only defined when that line is reached, whereas functionTwo is a function declaration and is defined as soon as its surrounding function or script is executed (due to hoisting). For example, a function expression: // TypeError: functionOne is not a function functionOne(); var functionOne … Read more

What does "use strict" do in JavaScript, and what is the reasoning behind it?

Update for ES6 modules Inside native ECMAScript modules (with import and export statements) and ES6 classes, strict mode is always enabled and cannot be disabled. Original answer This article about Javascript Strict Mode might interest you: John Resig – ECMAScript 5 Strict Mode, JSON, and More To quote some interesting parts: Strict Mode is a … Read more