KL
Size: a a a
KL
DD
function A(...args) { Array.call(this, ...args) }
A.prototype = Object.create(Array.prototype)
Object.defineProperty(A.prototype, 'constructor', { value: A, enumerable: false, writable: true})
a = new A()
MA
DD
ЛU
S
function A(pattern, what) {
RegExp.call(this, pattern);
this.what = what;
}
A.prototype = Object.create(RegExp.prototype);
Object.defineProperty(A.prototype, "constructor", {
value: A,
enumerable: false, // so that it does not appear in 'for in' loop
writable: true,
});
const a = new A(/.*/, "sdf");
console.log(a);
console.log("sdf".match(a));
ИМ
DD
d
BB
DT
ИМ
S
BB
DT
BB
ИМ