0

How to know whether an object is proxy?

function A(n){this.n=n;};

let a = new A(1);
let p = new Proxy(a,{});

console.log('p.constructor == Proxy; // ', p.constructor == Proxy);
console.log('p.constructor == A; // ', p.constructor == A);

console.log('Proxy.prototype: ', Proxy.prototype); // null

console.log('Object.getPrototypeOf(p) == Object.getPrototypeOf(a); // ', 
 Object.getPrototypeOf(p) == Object.getPrototypeOf(a));

console.log('\n');
Sagar V
  • 12,158
  • 7
  • 41
  • 68
Andrey Bushman
  • 11,712
  • 17
  • 87
  • 182

0 Answers0