on-internet
← Community

Vanilla JavaScript test for Proxy object vs. normal JS object

Stack Overflow ·

I wrapped my head around this problem and came up with this pretty neat solution: const isProxy = (proxy: any) => { if (typeof proxy !== 'object') return false const obj = new Object() return obj !== proxy.valueOf(obj) }

Comments

Sign in or sign up to comment and upvote.

No comments yet.