0Pricing
Frontend Academy · Lesson

Object Destructuring and Spread

Extract object properties with destructuring, clone and merge objects with the spread operator, and use rest parameters in function signatures.

What Is Destructuring?

Destructuring extracts values from objects and arrays into named variables. It's shorthand for multiple property access statements — it makes code concise and clearly communicates which properties are used.

Object Destructuring Basics

Use curly braces on the left side of an assignment to extract named properties.

const user = { name: 'Alice', age: 30, role: 'admin' };

// Without destructuring:
const name = user.name;
const age = user.age;

// With destructuring:
const { name, age, role } = user;
console.log(name); // 'Alice'
console.log(age);  // 30

All lessons in this course

  1. Array Methods: map filter reduce find
  2. Object Destructuring and Spread
  3. Template Literals and Optional Chaining
  4. Modules: import and export
← Back to Frontend Academy