Skip to main content

at

Creates an array of values corresponding to paths of object.

API

function at(object: any, paths: string | string[]): any[];

Usage

import { at } from '@feedzai/js-utilities';

const object = { 'a': [{ 'b': { 'c': 3 } }, 4] };

at(object, ['a[0].b.c', 'a[1]']);
// [3, 4]