The documentation for JSON.Object.insert states that it will overwrite values for the existing keys, but it is not overwriting, you have to delete the key manually before inserting an existing key.
I think the issue is that the underlying method used (assign) does not actually overwrite existing keys:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
The documentation for
JSON.Object.insertstates that it will overwrite values for the existing keys, but it is not overwriting, you have to delete the key manually before inserting an existing key.I think the issue is that the underlying method used (assign) does not actually overwrite existing keys:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign