"Destructuring is JavaScript's way of letting you unpack what you need and leave the rest behind."

Introduction

You've worked with arrays and objects in JavaScript. You know how to access their values. But have you noticed how repetitive it gets?

const user = { name: "Alice", age: 28, city: "Delhi" };

const name = user.name;