Q:

How do I take all of an object's properties and insert them into its own object array property?

For example I want something like:
{ 
  a: 1,
  b: 2,
  c: 3
}

turned into:
{
  d: { 
       a: 1,
       b: 2,
       c: 3
     }
}

I've tried assigning a new property to that object with the object itself but it shows up as circular so I figure it's a reference instead of the actual properties instead of the actual values. I want to try something like JSON.stringify the object and assign it to the property but I don't know how to turn that string into an object format that I can assign to the property.

A:

let firstObj = { 
  a: 1,
  b: 2,
  c: 3
}

let secondObj =  {};
secondObj.d = firstObj;
console.log(secondObj);

Basically you create a new object and assign the original object to its property d.

