If I have the following object:
JsonObj = {
\"frames\": {
\"cinema\": {
\"sourceSize\": { \"w\": 256, \"h\": 200 },
\"fra
Set the somethingElse
as a reference to what frames
points to, then delete frames
.
parsedJSON.somethingElse = parsedJSON.frames;
delete parsedJSON.frames;
The important thing here is that frames
is simply a pointer to an object; if you delete the frames
pointer, somethingElse
still references a valid object.
Also note there's no such thing as a "JSON object"; you have a JSON representation of an object, which is a string, or you have an object (which can often be defined via object literal notation, which is often where the confusion lies).