Javascript Array map(func)
Array.prototype.map = function(func) { var results=[]; this.forEach(function(value){ results.push(func(value));// ww w .ja va2s . com }); return results; }; array.map(function(value){ return value.symbol });
Array.prototype.map = function(func){ var result = []; forEach(this, function (element) { result.push(func(element));/* ww w . j a v a 2s . c o m*/ }); return result; }