1. Home
  2. Javascript
  3. Object destructuring

Use destructuring to pass variables to an object.

#javascript#object#es6
var color = "red";
var shape = "square";

buildObject({ color, shape });
copy
Full Javascript cheatsheet