How can you create an Array in JavaScript?

1 Answer(s)

You can define arrays using the array literal as follows −

var x = [];
var y = [1, 2, 3, 4, 5];
Supporter Answered on August 15, 2019.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.