Put in order · JavaScript and TypeScript course · Module 2: Functions, Arrays and Objects

Array Destructuring - Element Order

Arrange what will be assigned to variables in the destructuring const [a, , b] = ['Rex', 'Blue', 'Delta']:

Items to put in order

  • a = 'Rex'
  • b = 'Delta'
  • 'Blue' is skipped
Show the answer

Correct order:

  1. a = 'Rex'
  2. 'Blue' is skipped
  3. b = 'Delta'