on-internet
← Community

SOLUTION: 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.