Last active
January 26, 2018 22:37
-
-
Save Kadajett/e7768308b1151fee9687f328c48533fd to your computer and use it in GitHub Desktop.
Increment an integer on GET
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
var i = 1; | |
Object.defineProperty(window, 'n' , { | |
get() { | |
return i ++; | |
} | |
}) | |
// n == 1 | |
// n == 2 | |
// n == 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment