核心代码:
let dog = {
name: 'xiaogou'
};
let dogs = [];
// 添加对象
dogs.push(dog);
console.log(dogs);
// 根据对象删除
dogs.splice(dog);
console.log(dogs);
console.log('dogs.length:'+dogs.length);
效果图:
更多技术请关注QQ群:636212586