Which is the correct way to write a JavaScript array?

Options
- var txt = new Array(1:"arr",2:"kim",3:"jim")
- var txt = new Array:1=(" arr ")2=("kim")3=("jim")
- var txt = new Array("arr ","kim","jim")
- var txt = new Array=" arr ","kim","jim"


CORRECT ANSWER : var txt = new Array("arr ","kim","jim")

Discussion Board
correcr way

which is the correct way

mohammed 01-28-2015 03:04 PM

Write your comments


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement