DEV Community

Discussion on: Set Variable As A Key Name In JavaScript Object

Collapse
 
jonrandy profile image
Jon Randy 🎖️

In this example, it is much better to just use the obj[key] = value method. There really is no point making a brand new object every time