is something like this is make able i tried to put the var in [] but it didn't worked also can any one help please thank you
const obj = { car : "a" , bus: "b" };
const x = "car" ;
obj.x = "some value"
is something like this is make able i tried to put the var in [] but it didn't worked also can any one help please thank you
const obj = { car : "a" , bus: "b" };
const x = "car" ;
obj.x = "some value"
Looking for computed property names?
const obj = { car : "a" , bus: "b" };
const x = "a" ;
obj[x] = "some value"