DEV Community

Sk
Sk

Posted on

Daily dose of JavaScript

1

making a variable a key in an object, very useful if you want to make dynamic values keys

let myVar = "dynamicKey";

let myObj = { [myVar ] : value }

Enter fullscreen mode Exit fullscreen mode

Top comments (0)