7.
Which of the following methods can be used to create a new array in JavaScript?
Array.from()
Array.of()
Array.fill()
Array.concat()
Correct: A, B
In addition to using square brackets, JavaScript also provides methods like Array.from() and Array.of() to create new arrays. Array.from() creates a new array from an iterable object, while Array.of() creates a new array with the specified arguments as elements. Array.fill() and Array.concat() are used to manipulate existing arrays rather than creating new ones.