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="tim","kim","jim"

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

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

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

The correct Array constructor syntax is new Array("item1", "item2", "item3") with values as comma-separated arguments. Options B, C, and D use invalid syntax - you can't assign to Array with =, use numbered keys with colons, or use the colon-equals syntax shown.