I've tried googling this pretty extensively, but the relevant search terms are pretty vague and I haven't been able to find anything.
The object is coming from a third-party library (Jibestream).
Here's some hypothetical code:
const myObject = thirdPartyLibrary.getMyObject();
If I do console.log(myObject)
, I see this in my Chrome DevTools:
It looks like an object, but has this n
key that appears to be some identifier.
When I try to copy it, like so:
const newWaypointsArray = getNewWaypoints();
const myNewObject = { ...myObject, waypoints: newWaypointsArray };
And then do console.log(myNewObject)
, I see this:
Which is the same, but without the n
identifier.
Passing this new n
-less object back into methods provided by the third-party library doesn't work, while using the original object does work. I have to assume it's related to that n
identifier.
- Would that theory make sense, that their library would need to retain this identifier and that's why it's not working?
- Is there a way to copy the object without losing that identifier?
Thanks in advance.