Array.prototype.myPush = function (val) {
const arr = this;
arr[arr.length] = val;
return arr.length;
};
Array.prototype.myPop = function() {
数组push、pop、shift、unshift的模拟实现
最新推荐文章于 2023-05-26 15:20:22 发布
Array.prototype.myPush = function (val) {
const arr = this;
arr[arr.length] = val;
return arr.length;
};
Array.prototype.myPop = function() {