.map vs .each

jquery mao vs each

by bhupendra negi

JavaScript

var $array = [1,2,3,4,5];

function fun1(i){
 return i+1;

}

var items1 = $.map($array,fun1);
var items2 = $.each($array,fun1);

console.log("map result " + items1);
console.log("each result " + items2);