JS

Arrays in JavaScript - Declare initialize an array

3.

Which of the following is a valid way to declare and initialize an array with elements in JavaScript?

var myArray = [1, 2, 3];

var myArray = new Array(1, 2, 3);

var myArray = {1, 2, 3};

var myArray = array(1, 2, 3);