JQuery map vs Javascript map vs For-loop -


i'm implementing code natural fit map. however, have significant amount of objects in list i'm going iterate through, question best way go abou this:

var stuff = $.map(listofmyobjects, somefunction())  var stuff = listofmyobjects.map(somefunction()) 

or just

var stuff = new array();  for(var = 0; < listofmyobjects.length; i++){     stuff.push(somefunction(listofmyobjects[i])); } 

the latter (for loop) faster. remember seeing benchmark somewhere can't seem find link.

if performance issue use loop. doesn't obscure code much.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -