What is destructuring in JavaScript?
It allows unpacking values from arrays or objects.
Example:
const [a, b] = [1, 2];
const { name, age } = { name: "John", age: 30 };
It allows unpacking values from arrays or objects.
Example:
const [a, b] = [1, 2];
const { name, age } = { name: "John", age: 30 };