以下代码的输出结果是:let numbers = [1, 2, 3];let data = {};[data.foo, data.bar] = numbers;console.log(data);
A. 1,2
B. 1,3
C. { foo: 1, bar: 2 }
D. { foo: 1, bar: 3 }
在下列代码中,那段代码可以求算出numbers数组的最大值?
A. var numbers = [1, 1, 2, 3, 5, 8];var max = Math.max(numbers);
B. var numbers = [1, 1, 2, 3, 5, 8];var max = Math.max(...numbers);
C. var numbers = [1, 1, 2, 3, 5, 8];var max = Math.max(numbers...);
D. var numbers = [1, 1, 2, 3, 5, 8];var max = Math.max(*numbers);
以下代码的输出结果是:function sayHello(greeting = "Hello", name = "CampJS") {console.log(`${greeting} ${name}!`);}sayHello("Hi there");sayHello(undefined, null);
A. Hello CampJS!Hello CampJS!
B. Hi thereCampJS!undefined CampJS!
C. Hi thereCampJS!Hello null!
D. Hi thereCampJS!undefined null!