95.5k views
3 votes
Which of the following is the correct way for writing Java script array

User Harjot
by
8.3k points

1 Answer

4 votes

Answer:

The correct way to write a JavaScript array var txt = new Array("arr ","kim","jim"). JavaScript arrays are used to store multiple values in a single variable. Using an array literal is the easiest way to create a JavaScript Array.

User Qi Fan
by
8.1k points