Multiple choice technology

What is the correct way to write a JavaScript array?

  1. var txt = new Array("tim","kim","jim")

  2. var txt = new Array:1=("tim")2=("kim")3=("jim")

  3. var txt = new Array(1:"tim",2:"kim",3:"jim")

  4. var txt = new Array="tim","kim","jim"

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

JavaScript arrays can be created with new Array("item1","item2") (option A) or more commonly with array literals ["item1","item2"]. Option A shows the correct constructor syntax with comma-separated string values in parentheses.