Skip to content

Latest commit

 

History

History
51 lines (41 loc) · 1.88 KB

pull.md

File metadata and controls

51 lines (41 loc) · 1.88 KB

Object Agent

A javascript library for working with objects

npm build coverage deps size vulnerabilities license


pull(array, path) ⇒ Array

Pulls values from an array of objects into a new array.

Param Type Description
array Array Array of objects.
path string Dot delimited string of the path within each object.

Example

import { pull } from 'object-agent';

const array = [{
    a: { b: [1, 2, 3] }
}, {
    a: { b: [4, 5, 6] }
}];

pull(array, 'a.b.1'); // => [2, 5]