dist/bbn.js
/**
     * Executes the provided function on each element of the given array.
     * 
     * Returning false will stop the loop.
     *
     * @method   each
     * @global
     * @example
     * ```javascript
     * let res = 0;
     * bbn.fn.each([4, 5, 5, 10, 1, 2], d => {
     *   res += d;
     * });
     * // res = 27
     * ```
     * @example
     * ```javascript
     * let res = 0;
     * bbn.fn.each([4, 5, 5, 10, 1, 2], d => {
     *   if (res >= 20) {
     *     return false;
     *   }
     *   res += d;
     * });
     * // res = 24
     * ```
     * @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
     * @returns  {undefined}
     */
Executes the provided function on each element of the given array.

Returning false will stop the loop.


Executes the provided function on each element of the given array . Returning false will stop the loop .
each(arr, fn){
      if ( bbn.fn.isIterable(arr) ){
        for ( let i = 0; i < arr.length; i++ ){
          if ( fn(arr[i], i) === false ){
            return;
          }
        }
        return;
      }
      return bbn.fn.iterate(arr, fn);
    }
each ( arr , fn ) { if ( bbn . fn . isIterable ( arr ) ) { for ( let i = 0 ; i < arr . length ; i ++ ) { if ( fn ( arr [ i ] , i ) === false ) { return ; } } return ; } return bbn . fn . iterate ( arr , fn ) ; }
Executes the provided function on each element of the given array.
Executes the provided function on each element of the given array .