下面创建数组的方法正确的有( )。
A: var fruit=new Array("apple","banana","orange","peach");
B: var fruit={"apple","banana","orange","peach"};
C: var fruit=["apple","banana","orange","peach"];
D: var fruit=["apple","banana","orange",123];
A: var fruit=new Array("apple","banana","orange","peach");
B: var fruit={"apple","banana","orange","peach"};
C: var fruit=["apple","banana","orange","peach"];
D: var fruit=["apple","banana","orange",123];
举一反三
- 执行下面的语句后,输出为______ var fruit= new Array("apple", "orange", " peach","banana");fruit.push("paiapple");alert(fruit.length)
- 中国大学MOOC: "Fruit" is the hyponym of words like "banana", "apple", or "orange".
- 字典fruit={'apple':'red','peach':'pink','lemon':'orange'},fruit['lemon']的结果是( )。 A: 'pink' B: 'red' C: 'orange' D: Orange
- 下列语句执行后,di['fruit'][1]值为 。di={'fruit':['apple','banana','orange']}di['fruit'].append('watermelon')
- (4)请将香蕉banana用工具 H—Head,T—Tail从L中取出。 L=(apple,(orange,(strawberry,(banana)),peach),pear)