40. What's the output?
[[0, 1], [2, 3]].reduce(
(acc, cur) => {
return acc.concat(cur);
},
[1, 2],
);
40. What's the output?
Javob variantlari;
Javob variantlari;
Anonymous Quiz
0%
A: [0, 1, 2, 3, 1, 2]
0%
B: [6, 1, 2]
100%
C: [1, 2, 0, 1, 2, 3]
0%
D: [1, 2, 6]
41. What's the output?
Javob variantlari:
Javob variantlari:
Anonymous Quiz
0%
A: false true false
100%
B: false false true
0%
C: false true true
0%
D: true true false
42. What does the setInterval method return in the browser?
setInterval(() => console.log('Hi'), 1000);
setInterval(() => console.log('Hi'), 1000);
Anonymous Quiz
100%
A: a unique id
0%
B: the amount of milliseconds specified
0%
C: the passed function
0%
D: undefined
43. What does this return?
[...'Lydia'];
[...'Lydia'];
Anonymous Quiz
100%
A: ["L", "y", "d", "i", "a"]
0%
B: ["Lydia"]
0%
C: [[], "Lydia"]
0%
D: [["L", "y", "d", "i", "a"]]
44. What's the output?
function* generator(i) {
yield i;
yield i * 2;
}
const gen = generator(10);
console.log(gen.next().value);
console.log(gen.next().value);44. What's the output?
Javob variantlari:
Javob variantlari:
Anonymous Quiz
0%
A: [0, 10], [10, 20]
0%
B: 20, 20
100%
C: 10, 20
0%
D: 0, 10 and 10, 20
45. What does this return?
const firstPromise = new Promise((res, rej) => {
setTimeout(res, 500, 'one');
});
const secondPromise = new Promise((res, rej) => {
setTimeout(res, 100, 'two');
});
Promise.race([firstPromise, secondPromise]).then(res => console.log(res));45. What does this return?
Javob variantlari:
Javob variantlari:
Anonymous Quiz
0%
A: "one"
100%
B: "two"
0%
C: "two" "one"
0%
D: "one" "two"
46. What's the output?
let person = { name: 'Lydia' };
const members = [person];
person = null;
console.log(members);46. What's the output?
javob variantlari:
javob variantlari:
Anonymous Quiz
0%
A: null
0%
B: [null]
0%
C: [{}]
100%
D: [{ name: "Lydia" }]
47. What's the output?
const person = {
name: 'Lydia',
age: 21,
};
for (const item in person) {
console.log(item);
}47. What's the output?
Javob variantlari:
Javob variantlari:
Anonymous Quiz
0%
A: { name: "Lydia" }, { age: 21 }
100%
B: "name", "age"
0%
C: "Lydia", 21
0%
D: ["name", "Lydia"], ["age", 21]
48. What's the output?
console.log(3 + 4 + '5');
console.log(3 + 4 + '5');
Anonymous Quiz
0%
A: "345"
100%
B: "75"
0%
C: 12
0%
D: "12"
49. What's the value of num?
const num = parseInt('7*6', 10);
const num = parseInt('7*6', 10);
Anonymous Quiz
0%
A: 42
0%
B: "42"
100%
C: 7
0%
D: NaN
50. What's the output?
[1, 2, 3].map(num => {
if (typeof num === 'number') return;
return num * 2;
});50. What's the output?
Javob variantlari:
Javob variantlari:
Anonymous Quiz
0%
A: []
0%
B: [null, null, null]
100%
C: [undefined, undefined, undefined]
0%
D: [ 3 x empty ]
51. What's the output?
function getInfo(member, year) {
member.name = 'Lydia';
year = '1998';
}
const person = { name: 'Sarah' };
const birthYear = '1997';
getInfo(person, birthYear);
console.log(person, birthYear);51. What's the output?
Javob variantlari:
Javob variantlari:
Anonymous Quiz
100%
A: { name: "Lydia" }, "1997"
0%
B: { name: "Sarah" }, "1998"
0%
C: { name: "Lydia" }, "1998"
0%
D: { name: "Sarah" }, "1997"
52. What's the output?
function greeting() {
throw 'Hello world!';
}
function sayHi() {
try {
const data = greeting();
console.log('It worked!', data);
} catch (e) {
console.log('Oh no an error:', e);
}
}
sayHi();