UNPKG

rambdax

Version:

Extended version of Rambda - a lightweight, faster alternative to Ramda

16 lines (11 loc) 294 B
import { map } from './map.js' export function pluck(property, list){ if (arguments.length === 1) return _list => pluck(property, _list) const willReturn = [] map(x => { if (x[ property ] !== undefined){ willReturn.push(x[ property ]) } }, list) return willReturn }