Skip to content

Instantly share code, notes, and snippets.

@tomdale
Created November 15, 2014 20:05
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomdale/7d17530c12dbc104b15d to your computer and use it in GitHub Desktop.
Save tomdale/7d17530c12dbc104b15d to your computer and use it in GitHub Desktop.
destructuring assignment example
// before
var displayAnnotation = config.displayAnnotation,
width = config.width,
axisHeight = config.axisHeight,
barsLeftMargin = config.barsLeftMargin,
barsRightMargin = config.barsRightMargin;
// after
var { displayAnnotation,
width,
axisHeight,
barsLeftMargin,
barsRightMargin } = config;
@einarj
Copy link

einarj commented Nov 15, 2014

Nice!

@paulirish
Copy link

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment