Daily JavaScript
15 subscribers
1 photo
1 link
Daily examples, coding challenges, and useful tips for developers.
Download Telegram
34. What's the output?

Javob variantlari:
Anonymous Quiz
0%
A: "object"
100%
B: "number"
0%
C: "function"
0%
D: "undefined"
35. Which of these values are falsy?

0;
new Number(0);
('');
(' ');
new Boolean(false);
undefined;
36. What's the output?

console.log(typeof typeof 1); Javob variantlari:
Anonymous Quiz
0%
A: "number"
100%
B: "string"
0%
C: "object"
0%
D: "undefined"
37. What's the output?

const numbers = [1, 2, 3];
numbers[10] = 11;
console.log(numbers);
38. What's the output?

(() => {
let x, y;
try {
throw new Error();
} catch (x) {
(x = 1), (y = 2);
console.log(x);
}
console.log(x);
console.log(y);
})();
Mana o‘zbek tiliga tarjimasi:

**39. JavaScript’da hamma narsa quyidagilardan biri hisoblanadi…**
Anonymous Quiz
100%
A: primitive or object
0%
B: function or object
0%
C: trick question! only objects
0%
D: number or object
40. What's the output?

[[0, 1], [2, 3]].reduce(
(acc, cur) => {
return acc.concat(cur);
},
[1, 2],
);
41. What's the output?

!!null;
!!'';
!!1;
42. What does the setInterval method return in the browser?

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
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:
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:
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);