Last active
January 5, 2020 14:55
-
-
Save YonatanKra/2626c532c9050971e34e5cba75bbab14 to your computer and use it in GitHub Desktop.
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 createAndCount() { | |
const counter = { | |
count: 0 | |
}; | |
const objs = new Array(1000).fill(null).map(new Demo(counter)); | |
for (let i = 0; i < 1000; i++) { | |
for (let demo = 0; demo < 1000; demo++) { | |
const currBoom = objs[demo]; | |
currBoom.setMe(); | |
} | |
} | |
console.log(`Counter is: ${counter.count}`); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment