public
Last active

Object and array literals are faster than constructors

  • Download Gist
constructors.js
JavaScript
1 2 3 4
function usingConstructors( string )
{
var a = new Array(), o = new Object();
}
literals.js
JavaScript
1 2 3 4
function usingLiterals ( string )
{
var a = [], o = {};
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.