Skip to content

Latest commit

 

History

History
43 lines (35 loc) · 2.38 KB

every.md

File metadata and controls

43 lines (35 loc) · 2.38 KB

Async Agent

A javascript library of async functions

npm build coverage deps size vulnerabilities license


every(array, callback, [settings]) ⇒ Promise

Determine whether every element in an array passes an async test.

Returns: Promise - The promise is resolved after every callback is done or a callback returns true or an error is caught.

Param Type Default Description
array Array An array to iterate over.
callback function Parameters: element, index, and array.
Context: same as that provided to the main function.
Return: A falsey value to indicate a failure.
May return a Promise. Rejections are not caught.
[settings] object Optional settings object.
[settings.down] boolean false Decrement the index on each iteration from highest to lowest.
[settings.delay] number 0 Delay before calls in ms. Can be updated at any time to effect the delay before future calls.