var obj = {
"2": "a",
"3": "b",
"length": 2,
"push": Array.prototype.push
}
//属性要为索引(数字)属性,必须有length属性,最好加上push
//push 相当于这样
// Array.prototype.push = function (target){
// obj[obj.length] = target;
// obj.length ++;
// }
原文地址:https://www.cnblogs.com/hjysunshine/p/12151460.html
时间: 2024-10-25 00:09:18