jsBenchmarker

Source of "array_instantiate"

Back
(function(){
		  
	Benchmarker().compare({ attempts:10, times:3e4 }, {
		obj:function(){
			Array(1e3);
		},
		objNew:function(){
			new Array(1e3);
		},
		literal:function(){ 
			[].length = 1e3;
		}
	});

})();

/**
 * Conclusions
 *	To initialize an array with a certain amount of items,
 *  Array(size) can be faster than [ ].
 */