I found this example that says:
var arr=$.map([0,1,2],function(n){
return [n,n+1];
});
Will make arr a 6 item array. However, I don’t understand why it isn’t [[x,y],[x,y],[x,y]]
I need to know step by step what just happened. This map functions seems very useful, I would hate to don’t use it simply because I don’t understand its behavior.
$.mapflattens the returned array:Source: http://api.jquery.com/jQuery.map/