Last active
February 26, 2020 01:43
-
-
Save jwulf/c3b59f4915d4f644ea1a2c4ea0b26bed to your computer and use it in GitHub Desktop.
A code sample from the article https://www.joshwulf.com/blog/2020/02/avoid-global-state/
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
| //global variable | |
| var memArray =[]; | |
| //object | |
| function member(id, password){ | |
| this.id = id; | |
| this.pwd = password | |
| } | |
| var memObj1=new member("m001","123"); | |
| memArray.push(memObj1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment