wiki/content/20201103112001-destructuring_iterables.md

375 B

id title
96e9e4f6-8d7d-4a46-85ef-7cb3eb3804df Destructuring Iterables

Introduction

This was introduced in ES6. Destructuring iterables works on the same principle as arrays.

Syntax

const [x,...y] = 'abc'
console.log(x, y) // a ['b', 'c']