fork download
  1. function pluck(objects, fieldName) {
  2. var arr = [];
  3.  
  4. for (var i = 0; i <= objects.length; i++) {
  5.  
  6. for (var key in objects[i]) {
  7. if (key == fieldName) {
  8. arr.push(objects[i][key]);
  9. };
  10. }
  11. };
  12. return arr;
  13. }
Success #stdin #stdout 0.42s 321920KB
stdin
Standard input is empty
stdout
Standard output is empty