Home / Javascript Tips Generated By ChatGPT / Destructuring Arrays to Extract Values in Javascript Unpack values from arrays into distinct variables. Source Code let colors = ["red", "green", "blue"]; let [firstColor, secondColor] = colors; console.log(firstColor); // "red" console.log(secondColor); // "green"