JavaScript Destructuring

Destructuring allows you to take an object or array, and pull pieces of it out into local variables.

This can be useful to keep code more readable and avoid holding a reference to an object when you don’t need it any longer.

You can use this in both JavaScript and TypeScript.

View code on GitHub

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s