下面创建数组的方法正确的有( )。
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];
A,C,D
举一反三
- 执行下面的语句后,输出为______ 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)
内容
- 0
(All) fruit contains fiber: an orange provides seven, (a apple five), and a banana four, but (half of) a grapefruit (provides) six grams. A: All B: a apple five C: half of D: provides
- 1
以下代码的输出结果是。 d={‘fruit’:{‘apple’:4,’orange’:10}} print(d.get(‘apple’,’no’))( ) A: 4 B: no C: fruit D: orange
- 2
中国大学MOOC: 下列语句执行后,print(di[‘fruit’][1])值为【 】di={‘fruit’:[‘apple’,’banana’,’orange’]}di[fruit].append(‘watermelon’)
- 3
Fruit类有Apple和Orange两个子类,Fruit fruit=new Apple(); 该语句是对象类型转换中的_______转型。
- 4
I love ( ). A: banana B: apple C: grape D: orange