644774174
发表于 2021-6-23 16:32
666666666666666666
lvhanghmm
发表于 2021-6-23 16:39
class User {
constructor(id) {
this.id_ = id;
}
}
const proxy = new Proxy(User, {
construct(target, argumentsList, newTarget) {
if (argumentsList === undefined) {
throw'User cannot be instantiated without id';
} else {
return Reflect.construct(...arguments);
}
}
});
new proxy(1);
console.log('------------------------------')
new proxy();
// Uncaught User cannot be instantiated without id
sky2line
发表于 2021-6-24 09:32
是打发斯蒂芬发散
chujian
发表于 2021-6-24 13:46
JavaScript逆战班 入门到精通
venix
发表于 2021-6-30 21:00
avaScript逆战班 入门到精通
longlll
发表于 2021-6-30 22:44
JavaScript逆战班 入门到精通 [复制链接]
诗晗
发表于 2021-7-1 04:08
66666666666
17689665827
发表于 2021-7-1 05:04
66666666666
joraboy328
发表于 2021-7-2 10:28
VERY GOOOOOOOOOOOD
yaozp
发表于 2021-7-2 10:38
JavaScript逆战班 入门到精通