Last active
December 26, 2018 08:44
-
-
Save steveast/5d1fe69b602e5f290f3b8338033d03d3 to your computer and use it in GitHub Desktop.
Собеседование: use strict
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
'use strict' | |
x = 5; // error! next examples with let x | |
console.log(++x); // 6 | |
console.log(x++); // 6 | |
function foo() { | |
console.log(x); // undefined, because there is x below | |
x += 5; | |
console.log(x); // NaN | |
var x = 2; | |
console.log(x); // 2 | |
} | |
foo(); | |
console.log(x); // 7 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment