1. Home
  2. Javascript
  3. Object destructuring
#javascript#object#es6

Use destructuring to pass variables to an object.

var color = "red";
var shape = "square";

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