dist/bbn.js
/**
     * Returns a new object made of the properties from all the given objects.
     * 
     * Compared to bbn.fn.extend this still treats the arguments from left to right 
     * but without overwriting existing properties, and returning a new object.
     *
     * @method   extendOut
     * @global
     * @example
     * ```javascript
     * //{field1: 1, field2: 2, field3: 3, items: {item: 0, item1: 1, item2: 2}, field4: 4}
     * bbn.fn.extendOut({field1: 1, field2: 2, field3: 3, items: {item: 0}}, {field4: 4, items: {item1: 1, item2: 2}});
     * ```
     * @memberof bbn.fn
     * @returns  {Object}
     */
Returns a new object made of the properties from all the given objects.

Compared to bbn.fn.extend this still treats the arguments from left to right
but without overwriting existing properties, and returning a new object.


Returns a new object made of the properties from all the given objects . Compared to bbn . fn . extend this still treats the arguments from left to right but without overwriting existing properties and returning a new object .
extendOut(){
      let r = {};
      for ( let i = 0; i < arguments.length; i++ ){
        if ( typeof(arguments[i]) !== 'object' ){
          throw new Error("Each argument for bbn.fn.extendOut must be an object, " + typeof(arguments[i]) + " given");
        }
        if ( Array.isArray(arguments[i]) ){
          throw new Error("You cannot extend arrays with bbn.fn.extendOut");
        }
        if ( i === 0 ){
          r = arguments[0];
        }
        else{
          for ( let n in arguments[i] ){
            if ( (typeof(r[n]) === 'object') &&
              (typeof(arguments[i][n]) === 'object') &&
              !bbn.fn.isFunction(r[n]) &&
              !Array.isArray(r[n]) &&
              !Array.isArray(arguments[i][n])
            ){
              bbn.fn.extendOut(r[n], arguments[i][n]);
            }
            else if ( r[n] === undefined){
              r[n] = arguments[i][n];
            }
          }
        }
      }
      return r;
    }
extendOut ( ) { let r = { } ; for ( let i = 0 ; i < arguments . length ; i ++ ) { if ( typeof ( arguments [ i ] ) !== 'object' ) { throw new Error ( "Each argument for bbn.fn.extendOut must be an object, " + typeof ( arguments [ i ] ) + " given" ) ; } if ( Array . isArray ( arguments [ i ] ) ) { throw new Error ( "You cannot extend arrays with bbn.fn.extendOut" ) ; } if ( i === 0 ) { r = arguments [ 0 ] ; } else { for ( let n in arguments [ i ] ) { if ( ( typeof ( r [ n ] ) === 'object' ) && ( typeof ( arguments [ i ] [ n ] ) === 'object' ) && ! bbn . fn . isFunction ( r [ n ] ) && ! Array . isArray ( r [ n ] ) && ! Array . isArray ( arguments [ i ] [ n ] ) ) { bbn . fn . extendOut ( r [ n ] , arguments [ i ] [ n ] ) ; } else if ( r [ n ] === undefined ) { r [ n ] = arguments [ i ] [ n ] ; } } } } return r ; }
Returns a new object made of the properties from all the given objects.
Returns a new object made of the properties from all the given objects .