js/core/List.js
function (items, options) {


            options = options || {};
            _.defaults(options, {silent: false, index: this.$items.length});

            var index = options.index;

            if (!_.isArray(items)) {
                items = [items];
            }
            var item, itemIndex;
            for (var i = 0; i < items.length; i++) {
                item = items[i];
                if (item instanceof Bindable) {
                    item.bind('change', this._onItemChange, this);
                    item.bind('*', this._onItemEvent, this);
                }
                itemIndex = index + i;
                if (_.isUndefined(this.$items[itemIndex]) || itemIndex >= this.$items.length) {
                    this.$items[itemIndex] = item;
                } else {
                    this.$items.splice(itemIndex, 0, item);
                }
                if (options.silent !== true) {
                    this.trigger('add', {item: item, index: itemIndex});
                }
            }
        }
function (items, options) {


            options = options || {};
            _.defaults(options, {silent: false, index: this.$items.length});

            var index = options.index;

            if (!_.isArray(items)) {
                items = [items];
            }
            var item, itemIndex;
            for (var i = 0; i < items.length; i++) {
                item = items[i];
                if (item instanceof Bindable) {
                    item.bind('change', this._onItemChange, this);
                    item.bind('*', this._onItemEvent, this);
                }
                itemIndex = index + i;
                if (_.isUndefined(this.$items[itemIndex]) || itemIndex >= this.$items.length) {
                    this.$items[itemIndex] = item;
                } else {
                    this.$items.splice(itemIndex, 0, item);
                }
                if (options.silent !== true) {
                    this.trigger('add', {item: item, index: itemIndex});
                }
            }
        }
function ( items , options ) { options = options || { } ; _ . defaults ( options , { silent : false , index : this . $items . length } ) ; var index = options . index ; if ( ! _ . isArray ( items ) ) { items = [ items ] ; } var item , itemIndex ; for ( var i = 0 ; i < items . length ; i ++ ) { item = items [ i ] ; if ( item instanceof Bindable ) { item . bind ( 'change' , this . _onItemChange , this ) ; item . bind ( '*' , this . _onItemEvent , this ) ; } itemIndex = index + i ; if ( _ . isUndefined ( this . $items [ itemIndex ] ) || itemIndex >= this . $items . length ) { this . $items [ itemIndex ] = item ; } else { this . $items . splice ( itemIndex , 0 , item ) ; } if ( options . silent !== true ) { this . trigger ( 'add' , { item : item , index : itemIndex } ) ; } } }
This method adds one ore items to the array.
@param {Array|Object} items
@param {Object} options
This method adds one ore items to the array .