Created
November 7, 2016 11:01
-
-
Save edysegura/a52b15760b644f84adbe700d3cd54383 to your computer and use it in GitHub Desktop.
[JS] Why use strict mode in JavaScript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function withoutStrict() { | |
console.log(this) | |
} | |
function withStrict() { | |
"use strict"; | |
console.log(this) | |
} | |
withoutStrict() //object window | |
withStrict() //undefined |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment