From 5e0bbf3ecb7750e88b8b64f91dfb689c267b1a82 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 17 Feb 2015 08:50:42 -0500 Subject: [PATCH] refactor(util) getNamesFromObjArray: forEach -> map --- lib/util.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/util.js b/lib/util.js index 8f8c9b31..057ec8fa 100644 --- a/lib/util.js +++ b/lib/util.js @@ -533,8 +533,8 @@ if (!Array.isArray(arr)) throw(Error('arr should be array!')); - arr.forEach(function(item) { - ret.push(item.name); + ret = arr.map(function(item) { + return item.name; }); return ret;