31.
Which of the following correctly declares and initializes an array in JavaScript?
var arr = ();
var arr = 5;
var arr = [1, 2, 3];
var arr = "apple";
Correct: C
In JavaScript, arrays can be declared and initialized using square brackets [ ]. Option 3 correctly initializes an array with three elements: 1, 2, and 3. The other options are incorrect because they do not follow the correct syntax for declaring and initializing arrays.