0 votes
in JavaScript by
How to create an array in JavaScript?

1 Answer

0 votes
by

There are 3 ways to create an array in JavaScript.

  1. By array literal
  2. By creating an instance of Array
  3. By using an Array constructor

Let's see a simple code to create an array using object literal.

  1. var emp=["Shyam","Vimal","Ratan"];    

Related questions

0 votes
asked Apr 24 in JAVA by Robin
0 votes
asked Jan 9, 2021 in JavaScript by SakshiSharma
...