1.
How do you declare an empty array in JavaScript?
var arr = [];
var arr = new Array();
var arr = {};
var arr = "";
Correct: A, B
In JavaScript, you can declare an empty array using either the [] shorthand notation or the new Array() constructor. Both methods create an empty array that can be populated with elements later on. Options A3 and A4 are incorrect as they declare an empty object and an empty string respectively, not an empty array.
1 / 30