@kingjs/descriptor.nested.array.for-each

1.0.4 • Public • Published

@kingjs/descriptor.nested.array.for-each

Invokes a callback on each value of a array tree.

Usage

Replace the name of the person followed with the object representing the person being followed like this:

var forEach = require('@kingjs/descriptor.nested.array.for-each');

var tree = [['bob'], 'chris', 'alice'];

var result = { };
forEach(
  tree,
  x => result[x] = true
)

result:

[
  bob: true,
  chris: true,
  alice: true
]

API

declare function forEach(
  tree: NestedDescriptor,
  callback: (value) => any,
  thisArg?
)

Interfaces

Parameters

  • tree: The array tree whose values are going to be updated.
  • callback: Used to update values of tree:
    • value: The current value.
  • thisArg: The this argument to pass to callback.

Install

With npm installed, run

$ npm install @kingjs/descriptor.nested.array.for-each

License

MIT

Analytics

Readme

Keywords

none

Package Sidebar

Install

npm i @kingjs/descriptor.nested.array.for-each

Weekly Downloads

0

Version

1.0.4

License

MIT

Unpacked Size

3.5 kB

Total Files

4

Last publish

Collaborators

  • kingces95