I have an object:
let object1 = { a: 'one', b: 'two', c: 'three' };
I'm trying to set object1.a to be a key for object2:
object2 = { key: 'something' };
I tried to make key as:
[object1].a
object1.a
object1[a]
I remember I have to use bracket notation but can't figure out how to do this?
The reason I want to do this is because I'm going to change the values of object1 depending on props so I can just have a single component that changes key based on prop received.