使用JavaScript实现Java的List功能(实例讲解)

上传:pkunkfeifei 浏览: 15 推荐: 0 文件:PDF 大小:23.2KB 上传时间:2020-12-13 07:25:45 版权申诉
代码如下:/** * js模拟java中的List */ var list = new Array(); /** * 添加 * @param {Object} object */function add(object) { list[list.length] = object;} /** * 移除此列表中指定位置上的元素。 * @param index 指定位置 * @return 此位置的元素 */function removeIndex(index) { var object = this.list[index]; this.list.splice(index, 1); retur
上传资源
用户评论