28.
What should the console display when the following code is run?
const [, , animal] = ['Dog', 'Cat', 'Mouse'];
console.log(animal)
Dog
Cat
Mouse
Undefined
Correct: C
The code uses destructuring assignment to assign the third element of the array ['Dog', 'Cat', 'Mouse'] to the variable 'animal'. Therefore, the console should read "Mouse".