- A variable must declare using
varkeyword, which could avoid accidentally creating global variables. - User strict mode STOP
thisbeing a global valuable and set "undefined" as default value.
- Look at below table. In JavaScript, this is unstable and it is different how this is called. In Non-strict mode, this refers a global valuable and most of the case, it is confused and stop being as a global valuable.

Non-strict mode
console.log(this); // Window ObjectStrict mode
"use strict";
console.log(this); // Window ObjectNon-strict mode
function test(){
console.log(this);
}
test();// Window objectStrict mode
"use strict";
function test(){
console.log(this);
}
test();// undefined"strict mode" set "undefined" as default value.