π103π€18π₯16π9β€6
Which method creates a new array without mutating the original one?
Anonymous Quiz
29%
.splice()
34%
.slice()
15%
.push()
13%
.sort()
9%
See answer π€―
How do you convert an object to a JSON string?
Anonymous Quiz
25%
JSON.toString(obj)
7%
stringify(obj)
60%
JSON.stringify(obj)
4%
String(obj)
4%
See answer
What does ... (spread operator) do in arrays?
Anonymous Quiz
9%
Copies elements
11%
Joins arrays
42%
Expands elements into a new array
33%
All above
5%
See answer
Whatβs the difference between == and ===?
Anonymous Quiz
89%
== compares by value, === by type + value
6%
=== is slower
4%
Theyβre the same
1%
See answer
What happens if you call setTimeout(fn, 0)?
Anonymous Quiz
21%
Executes immediately
72%
Waits for 0 ms but after current call stack
8%
Blocks main thread
How to stop event bubbling?
Anonymous Quiz
12%
event.block()
21%
event.stop()
61%
event.stopPropagation()
7%
See answer
β€1
What does const actually mean?
Anonymous Quiz
22%
Cannot be changed
26%
Cannot be reassigned
47%
Both
5%
See answer
β€5
π₯5β€1π1π1
What does document.querySelector() return?
Anonymous Quiz
38%
HTMLCollection
25%
NodeList
31%
First matching element
7%
See answer
β€1π1
console.log([1, 2, 3].filter(x => x > 1));
Anonymous Quiz
73%
[2, 3]
9%
[1, 2]
13%
true
5%
See answer
π1
How to clone an object correctly?**
let user = {name: 'John'}.
let user = {name: 'John'}.
Anonymous Quiz
11%
let copy = user;
56%
let copy = {...user};
27%
let copy = user.clone()
6%
See answer
π1
What will happen?
const arr = [1, 2, 3]; arr[10] = 5; console.log(arr.length);
const arr = [1, 2, 3]; arr[10] = 5; console.log(arr.length);
Anonymous Quiz
24%
3
29%
10
34%
11
13%
See answer
π1
Why does this Timer component cause a memory leak?
Anonymous Quiz
26%
setCount is wrong inside interval
13%
React canβt handle intervals
43%
Needs to use setInterval in useEffect
18%
See Answer
π3β€2π€1
What will the code log
Anonymous Quiz
32%
{ name: 'John' } then { name: 'Bob' }
11%
{} then { name: 'Bob' }
25%
{ name: 'John' } then { name: 'John' }
13%
Error will be thrown
20%
See answer
β€4π2