dist/bbn.js
/**
     * 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.
     * 
     * @method   fori
     * @global   
     * @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
     * ```
     * @memberof bbn.fn
     * @param    {Array}     arr The array to loop on
     * @param    {Function}  fn  The function, gets the array's element and the index as arguments
     * @param    {Number}    max The index to which the loop will stop
     * @param    {Number}    min The index at which the loop will start
     * @returns  {undefined}
     */
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.


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 .
fori(arr, fn, max = arr.length - 1, min = 0) {
      if (bbn.fn.isArray(arr)) {
        let realMax = arr.length - 1;
        if (!bbn.fn.isNumber(max) || !(0 < max <= realMax)) {
          max = realMax;
        }
        if (!bbn.fn.isNumber(min) || !(0 <= min < realMax) || (min > max)) {
          min = 0;
        }
        for ( let i = min; i <= max; i++ ){
          if ( fn(arr[i], i) === false ){
            return;
          }
        }
      }
    }
fori ( arr , fn , max = arr . length - 1 , min = 0 ) { if ( bbn . fn . isArray ( arr ) ) { let realMax = arr . length - 1 ; if ( ! bbn . fn . isNumber ( max ) || ! ( 0 < max <= realMax ) ) { max = realMax ; } if ( ! bbn . fn . isNumber ( min ) || ! ( 0 <= min < realMax ) || ( min > max ) ) { min = 0 ; } for ( let i = min ; i <= max ; i ++ ) { if ( fn ( arr [ i ] , i ) === false ) { return ; } } } }
Executes the provided function on each element of the given array.
Executes the provided function on each element of the given array .