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;