I was wondering how to get an array out of a proxy's target value in JavaScript. I have something like this :
Proxy :
[[target]] : Array // the array I need to extract
[[handler]] : Object
[[IsRevoked]] : false
Just take that original object and parse it to and from JSON and get yourself a clean object!
item = JSON.parse(JSON.stringify(item))
If all you have is a reference to the proxy, there is no way (by default) for you to get the proxy's target. A specific proxy could provide a way (via one of its trap handlers, probably), but there is none by default.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With