In a non-strict-mode scope, when a variable is assigned without being initialized with the var, const or the let keyword, it is automatically declared in the global scope:
a = 12;
console.log(a); // 12
In strict mode however, any access to an undeclared variable will throw a reference error:
&...