22. How long is cool_secret accessible?
sessionStorage.setItem('cool_secret', 123);
sessionStorage.setItem('cool_secret', 123);
Anonymous Quiz
0%
A: Forever, the data doesn't get lost.
100%
B: When the user closes the tab.
0%
C: When the user closes the entire browser, not only the tab.
0%
D: When the user shuts off their computer.
23. What's the output?
Javob variantlari:
Javob variantlari:
Anonymous Quiz
0%
A: 8
100%
B: 10
0%
C: SyntaxError
0%
D: ReferenceError
24. What's the output?
const obj = { 1: 'a', 2: 'b', 3: 'c' };
const set = new Set([1, 2, 3, 4, 5]);
obj.hasOwnProperty('1');
obj.hasOwnProperty(1);
set.has('1');
set.has(1);24. What's the output?
Javob variantlari:
Javob variantlari:
Anonymous Quiz
0%
A: false true false true
0%
B: false true true true
100%
C: true true false true
0%
D: true true true true
25. What's the output?
const obj = { a: 'one', b: 'two', a: 'three' };
console.log(obj);25. What's the output?
Javob variantlari:
Javob variantlari:
Anonymous Quiz
0%
A: { a: "one", b: "two" }
0%
B: { b: "two", a: "three" }
100%
C: { a: "three", b: "two" }
0%
D: SyntaxError
26. The JavaScript global execution context creates two things for you: the global object, and the "this" keyword.
Javob variantlari:
Javob variantlari:
Anonymous Quiz
100%
A: true
0%
B: false
0%
C: it depends
27. What's the output?
for (let i = 1; i < 5; i++) {
if (i === 3) continue;
console.log(i);
}27. What's the output?
Javob variantlari:
Javob variantlari:
Anonymous Quiz
0%
A: 1 2
0%
B: 1 2 3
100%
C: 1 2 4
0%
D: 1 3 4
28. What's the output?
String.prototype.giveLydiaPizza = () => {
return 'Just give Lydia pizza already!';
};
const name = 'Lydia';
console.log(name.giveLydiaPizza())28. What's the output?
Javob variantlari:
Javob variantlari:
Anonymous Quiz
0%
A: "Just give Lydia pizza already!"
0%
B: TypeError: not a function
0%
C: SyntaxError
0%
D: undefined
29. What's the output?
const a = {};
const b = { key: 'b' };
const c = { key: 'c' };
a[b] = 123;
a[c] = 456;
console.log(a[b]);29. What's the output?
Javob variantlari:
Javob variantlari:
Anonymous Quiz
0%
A: 123
100%
B: 456
0%
C: undefined
0%
D: ReferenceError
30. What's the output?
const foo = () => console.log('First');
const bar = () => setTimeout(() => console.log('Second'));
const baz = () => console.log('Third');
bar();
foo();
baz();30. What's the output?
Javob variantlari:
Javob variantlari:
Anonymous Quiz
0%
A: First Second Third
100%
B: First Third Second
0%
C: Second First Third
0%
D: Second Third First
31. What is the event.target when clicking the button?
<div onclick="console.log('first div')">
<div onclick="console.log('second div')">
<button onclick="console.log('button')">
Click!
</button>
</div>
</div>32. When you click the paragraph, what's the logged output?
<div onclick="console.log('div')">
<p onclick="console.log('p')">
Click here!
</p>
</div>32. When you click the paragraph, what's the logged output?
Javob variantlari:
Javob variantlari:
Anonymous Quiz
100%
A: p div
0%
B: div p
0%
C: p
0%
D: div
33. What's the output?
const person = { name: 'Lydia' };
function sayHi(age) {
return `${this.name} is ${age}`;
}
console.log(sayHi.call(person, 21));
console.log(sayHi.bind(person, 21));