Skip to main content

Command Palette

Search for a command to run...

Destructuring assignment In JS

Published
โ€ข1 min readโ€ขView as Markdown

Destructuring assignment : it's a JS assignment expersionn that lets us unpack values from
[ 1. arrays or 2. properties from objects, ] into distinct variables.

Source

1) Array destructuring

  1.1) Default values
  1.2)  Swapping variables
  1.3) Unpacking values from a regular expression match

2) Object destructuring

More from this blog

JSDev

21 posts