How to create an object property from a variable value in JavaScript? [duplicate]

There’s the dot notation and the bracket notation

myObj[a] = b;

Leave a Comment