Creating an object using object structuring

Pulling attributes from an object is yet another repetitive task. There seems to be unnecessary repetition. Newer versions of ECMAScript include a syntactic feature that makes this process less onerous. This recipe demonstrates how to use object destructuring to pull new variables from object props.

Get ECMAScript Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.