var steve = function() {
this.test = new function() {
console.log('new thing');
}
this.test_not_repeating = function() {
console.log('not repeating');
}
};
steve.prototype.test = function() {
console.log('test');
};
for (var i = 0; i < 100; i++) {
var y = new steve();
}
Why does the new keyword force the function to be evaluated X times, where not using the new keyword doesn't? My rudimentary understanding of javascript is, if you do not put the function on the prototype it will be evaluated X times regardless of the new keyword or not.
steve.prototype.test = function () { console.log('test'); };The styling is just badsteve) function.