單項(xiàng)選擇題定義JavaScript數(shù)組的正確方法是?()

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


您可能感興趣的試卷

你可能感興趣的試題

1.單項(xiàng)選擇題如何在JavaScript中添加注釋?()

A.' This is a comment
B.< !--This is a comment-->
C.//This is a comment

2.單項(xiàng)選擇題for循環(huán)如何開始?()

A.for (i <= 5; i++)
B.for (i = 0; i <= 5; i++)
C.for (i = 0; i <= 5)
D.for i = 1 to 5

3.單項(xiàng)選擇題如何編寫當(dāng)i不等于5時(shí)執(zhí)行某些語句的條件語句?()

A.if =! 5 then
B.if <>5
C.if (i <> 5)
D.if (i != 5)

4.單項(xiàng)選擇題如何編寫當(dāng) i 等于 5 時(shí)執(zhí)行某些語句的條件語句?()

A.if (i==5)
B.if i=5 then
C.if i=5
D.if i==5 then

5.單項(xiàng)選擇題如何創(chuàng)建函數(shù)?()

A.function:myFunction()
B.function myFunction()
C.function=myFunction()