Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Array.prototype.forEachN()

Pass all array members to a callback function, n members at a time.

Syntax

arr.forEachN(n, callback(...args)[, thisArg])

Parameters

n
Number of elements to pass to callback at a time.

callback
Function to call.

thisArg
A value to bind this to. If not set, this refers to the Array instance.

Returns

undefined.

Example

[1,2,3,4].forEachN(2, (arr) => console.log(arr));
// [ 1, 2 ]
// [ 3, 4 ]

About

Pass all array members to a callback function, n members at a time.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages