• Home
  • Recent Q&A
  • Java
  • Cloud
  • JavaScript
  • Python
  • SQL
  • PHP
  • HTML
  • C++
  • Data Science
  • DBMS
  • Devops
  • Hadoop
  • Machine Learning
in JavaScript by
Q:
How can you create an Array in JavaScript?

1 Answer

0 votes
by
You can define arrays using the array literal as follows −

var x = [];

var y = [1, 2, 3, 4, 5];

Related questions

0 votes
asked Mar 20, 2021 in JavaScript by sharadyadav1986
0 votes
asked Sep 19, 2021 in JavaScript by sharadyadav1986
...