Created
December 10, 2023 06:47
-
-
Save pallove/59c1ee78dacd79b20c721892cb59631b to your computer and use it in GitHub Desktop.
check whether javascript object is a proxy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const isProxy = obj => { | |
try { | |
let test = {obj : true} | |
test[obj] = false | |
} catch { | |
return true | |
} | |
return false | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment