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 27, 2023 in GoLang by Robin
0 votes
asked Dec 1, 2022 in JavaScript by john ganales
...