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"];    
...