lib/Ext/Container.js
function(index, item) {
        var me = this,
            i;

        //<debug error>
        if (typeof index != 'number') {
            Ext.Logger.error("Invalid index of '" + index + "', must be a valid number");
        }
        //</debug>

        if (Ext.isArray(item)) {
            for (i = item.length - 1; i >= 0; i--) {
                me.insert(index, item[i]);
            }

            return me;
        }

        item = this.factoryItem(item);

        this.doInsert(index, item);

        return item;
    }
function(index, item) {
        var me = this,
            i;

        //<debug error>
        if (typeof index != 'number') {
            Ext.Logger.error("Invalid index of '" + index + "', must be a valid number");
        }
        //</debug>

        if (Ext.isArray(item)) {
            for (i = item.length - 1; i >= 0; i--) {
                me.insert(index, item[i]);
            }

            return me;
        }

        item = this.factoryItem(item);

        this.doInsert(index, item);

        return item;
    }
Adds a child Component at the given index. For example, here's how we can add a new item, making it the first
child Component of this Container:

myContainer.insert(0, {xtype: 'panel', html: 'new item'});

@param {Number} index The index to insert the Component at.
@param {Object} item The Component to insert.