Javascript Array extract(attribute)

Description

Javascript Array extract(attribute)


"use strict";// w w w  . j a  va2 s  .co  m

Array.prototype.extract = function(attribute) {
 var newArr = [];
 
 for (var i = 0; i < this.length; i++) {
  newArr.push(this[i][attribute]);
 }
 
 return newArr;
}



PreviousNext

Related