0 of 8 problems solved • 0%
Use in a course

Exercise prompt

Unpack an Array

Array destructuring assigns array positions to variables in one statement. The variable names inside the brackets match the array order.

Example

const sizes = ["small", "large"]; const [firstSize, secondSize] = sizes;

Your task

Destructure route into startCity and endCity, then display Route: Stockholm to Uppsala.