Skip to content

Instantly share code, notes, and snippets.

@fforres
Last active December 10, 2016 19:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fforres/a1caa7103289ce9c8db640fc895114dc to your computer and use it in GitHub Desktop.
Save fforres/a1caa7103289ce9c8db640fc895114dc to your computer and use it in GitHub Desktop.
function Dog(name) {
this.name = name;
this.bark = function () {
console.log("Guau!")
}
}
let d = []
for(let i = 0; i<1000000; i++) {
d[i] = new Dog(i)
}
console.log(d.length)
function Dog(name) {
this.name = name;
}
Dog.prototype.bark = function () {
console.log("Guau!")
}
let d = []
for(let i = 0; i<1000000; i++) {
d[i] = new Dog(i)
}
console.log(d.length)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment