1
This commit is contained in:
15
20220330_Vote/Ewide.Web.Entry/wwwroot/lib/xe-utils/pluck.js
Normal file
15
20220330_Vote/Ewide.Web.Entry/wwwroot/lib/xe-utils/pluck.js
Normal file
@@ -0,0 +1,15 @@
|
||||
var map = require('./map')
|
||||
var property = require('./property')
|
||||
|
||||
/**
|
||||
* 获取数组对象中某属性值,返回一个数组
|
||||
*
|
||||
* @param {Array} array 数组
|
||||
* @param {String} key 属性值
|
||||
* @return {Array}
|
||||
*/
|
||||
function pluck (obj, key) {
|
||||
return map(obj, property(key))
|
||||
}
|
||||
|
||||
module.exports = pluck
|
||||
Reference in New Issue
Block a user