Multiple choice technology web technology

What is the correct way to write a JavaScript array?

  1. var txt = new Array(1:"tim",2:"kim",3:"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="tim","kim","jim"

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

JavaScript arrays can be created with new Array() constructor taking comma-separated values in parentheses. Option B is correct. Options A, C, and D use invalid syntax with colons, equals signs, or missing parentheses.