close
function Queue(){
this.start_index=1;
this.end_index=1;
this.container={};
}
Queue.prototype.enqueue=function(data){
console.log("shit");
this.container[this.end_index++]=data;
//先做完動作再++
}
Queue.prototype.view=function(){
return this.container;
}
window.onload=function(){
var q=new Queue();
q.enqueue("shit");
q.enqueue("shit1");
console.log(q.view());
}
全站熱搜