Method fori documentation

Executes the provided function on each element of the given array.

Example

```javascript let res = 0; bbn.fn.fori([4, 5, 5, 10, 1, 2], d => { res += d; }, 3); // res = 24 ```

Example

```javascript let res = 0; bbn.fn.fori([4, 5, 5, 10, 1, 2], d => { if (res >= 20) { return false; } res += d; }, 4, 1); // res = 20 ```

Executes the provided function on each element of the given array. - A minimum and a maximum value can be provided, within the boundaries of the array's indexes. Returning false will stop the loop. BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way

This website uses cookies to ensure you get the best experience on our website.