定义的 add 方法,调用的是 push 方法...
为什么把 push 改回 add 会报方法不存在?
class PersonCollection extends Array {
constructor(name, ...items) {
super(...items);
this.name = name;
}
add(item) {
this.push(item);
}
}
const collection = new PersonCollection('name',
{'name': 'zhangsan'},
{'name': 'lisi'}
);
collection.add({'name': 'wangwu'});
console.log(collection);
//Uncaught TypeError: collection.add is not a function
牛湳器不支持...
好吧,我以为是跟你设计的效果有偏差.. 就反馈一下.. ( ̄. ̄)
jelly,改版把视频播放速度去掉了?还有这网页的阴影有点重啊,看着有点扎眼...
测试一下回复...
\Dingo\Api\Http\Response\Factory
方法提供的...