Skip to content
Advertisement

dynamicly nested object from another object

trying to figure out how to dynamicly create a new nested object from this one:

JavaScript

to nested one like this:

JavaScript

keys and values have to by dynamic. Only important thing is a structure of the final object. Any ideas would be greatly appricieated.

Advertisement

Answer

To create a new instance (i.e preserve the old one)

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement