You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
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
|
|
|