Last active
March 11, 2016 10:51
-
-
Save kikar/b9affe87f4f6f9769643 to your computer and use it in GitHub Desktop.
Not this
This file contains 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 foo(num) { | |
console.log( "foo: " + num ); | |
this.count++; | |
} | |
foo.count = 0; | |
foo(1); // foo: 1 | |
foo(5); // foo: 5 | |
foo(10); // foo: 10 | |
console.log('Wrong: ', foo.count ); // Wrong: 0 | |
console.log('Right: ', count); // Right: NaN |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment