function List(){
var list = new Array();
/* 添加元素 */
this.add = function(obj){
list[list.length] = obj;
}
/* 根据下标获得元素 */
this.get = function(index){
return list[index];
}
/* 根据下标移除元素 */
this.remove = function(index){
var obj = list[index];
list.splice(index, 1);
return obj;
}
/* 清空对象中元素 */
this.clear = function(){
list.splice(0, list.length);
}
/* 对象元素大小 */
this.size = function(){
return list.length;
}
}
Copyright © 2019- uude.cn 版权所有
违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务