Bootstrap

Array.prototype.push结合apply 实现 object 伪装数组

var Visitor = {}
Visitor .push  =  function(){
    return Array.prototype.push.apply( this, arguments );
}
var obj = {};
obj.push = Visitor .push;
obj.push( '"first" );
alert ( obj[0] )  
//"first"
alert ( obj.length );  

;