I have the following variables:
$firstSection = $main.children[0];
$secondSection = $main.children[1];
To use array destructuring on the first variable, I can do this: [$firstSection] = $main.children;
However, how am I supposed to use array destructuring on the second variable? Thanks.
Just put the second item to destructure to the right of the first, in a comma-separated list. It looks very similar to when declaring an array with 2 items.
const [$firstSection, $secondSection] = $main.children;