Socket
Book a DemoInstallSign in
Socket

@bemoje/arr-for-each-reverse

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bemoje/arr-for-each-reverse

Iterate an array in reverse.

latest
Source
npmnpm
Version
1.1.1
Version published
Maintainers
1
Created
Source

@bemoje/arr-for-each-reverse

Iterate an array in reverse.

Version

NPM version

Travis CI

dependencies

Dependencies

dependencies

Stats

NPM downloads Forks

Donate

Buy Me A Beer donate button PayPal donate button

Installation

npm install @bemoje/arr-for-each-reverse
npm install --save @bemoje/arr-for-each-reverse
npm install --save-dev @bemoje/arr-for-each-reverse

Usage

import arrForEachReverse from '@bemoje/arr-for-each-reverse'

const arr = ['a', 'b', 'c']

arrForEachReverse(arr, (element, index, array) => {
	console.log({ element, index, array })
})
//=> { element: 'c', index: 2, array: [ 'a', 'b', 'c' ] }
//=> { element: 'b', index: 1, array: [ 'a', 'b', 'c' ] }
//=> { element: 'a', index: 0, array: [ 'a', 'b', 'c' ] }

Tests

Uses Jest to test module functionality. Run tests to get coverage details.

npm run test

API

arrForEachReverse

Iterate an array in reverse.

Parameters
  • arr Array The array

  • callback callback callback(arr[i], i, arr)

Returns

void

callback

Type: Function

Parameters
  • element any The current element

  • index number The current element's index in the array

  • array Array The array

Keywords

iterate

FAQs

Package last updated on 30 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts