TIL: Destructuring function arguments in JavaScript

Today I learned you can destructure function arguments in JavaScript with ES6

Posted by Jason Merino on February 24, 2016

So check this out! If you have a function that accepts an object as an argument and you don’t want pull each of the properties of that argument out one by one, what a hassle, right?, you can destructure the argument in the function argument signature to access each of the arguments properties directly.

Here it is in action.

JS Bin on jsbin.com

How cool is that?!

jason merino

Jason Merino

Jason is a software engineer specializing in JavaScript and web technologies. An avid gardener, aspiring carpenter and a blessed family man.