What is the purpose of the "If" statement in JavaScript?
Anonymous Quiz
67%
To execute a block of code conditionally
9%
To define a function
15%
To create a loop
9%
To declare a variable
What is the "useState" hook in React used for?
Anonymous Quiz
21%
To define component style
18%
To manage global state
7%
To create routing in React
54%
To manage component state in functional components
👍2❤1
Find the error in the code.
Difficulty: Easy😁
Difficulty: Easy😁
function add(a, b) {
return a + b;
}
const result = add(5);
console.log(result);What is the purpose of the "Context API" in React?
Anonymous Quiz
13%
To define component style
39%
To manage global state
17%
To create routing in React
30%
To fetch data from external APIs
❤🔥1👍1👏1
What does the "margin: 0 auto;" CSS rule do?
Anonymous Quiz
20%
Adds a 0-pixel margin at the top and bottom
17%
Removes all margins from an element
53%
Centers an element horizontally within its container
10%
Applies a margin only to the left side of an element
Find the error in the code.
Difficulty: Hard😤
Difficulty: Hard😤
async function fetchData() {
const response = await fetch('https://api.example.com/data');
const data = await response.json();
return data;
}
async function processData() {
const data = fetchData();
console.log(data);
}
processData();Which HTML tag is used to define a list of key-value pairs?
Anonymous Quiz
29%
<list>
32%
<dl>
20%
<ul>
20%
<ol>
JavaScript Task
Write a double function that takes an array of numbers and returns a new array with each number multiplied by 2.
Difficulty: Average🤨
Write a double function that takes an array of numbers and returns a new array with each number multiplied by 2.
Difficulty: Average🤨
const numbers = [1, 2, 3, 4, 5];
const doubledNumbers = double(numbers);
console.log(doubledNumbers);
Which JavaScript method is used to create a new instance of a Date object?
Anonymous Quiz
18%
Date.create()
44%
new Date()
10%
Date()
28%
Date.new()
Find the error in the code.
Difficulty: Average🤨
Difficulty: Average🤨
const person = {
name: "John",
greet: function() {
setTimeout(function() {
console.log(Hello, my name is ${this.name});
}, 1000);
}
};
person.greet();Which CSS property is used to create space between elements on a page?
Anonymous Quiz
47%
margin
12%
border-spacing
25%
padding
16%
space
JavaScript Task
Write a greet function that takes a name and prints the message "Hello, [name]!".
Difficulty: Easy 😁
Write a greet function that takes a name and prints the message "Hello, [name]!".
Difficulty: Easy 😁
greet("John");
greet("Alex");Which HTML element is used to define a navigation section?
Anonymous Quiz
10%
<n>
8%
<navigate>
10%
<section>
72%
<nav>
❤3🔥2👍1
What will this code output?
Difficulty: Average🤨
Difficulty: Average🤨
const obj1 = { name: 'Alice' };
const obj2 = { name: 'Alice' };
if (obj1 === obj2) {
console.log("true");
} else {
console.log("false");
}👍2
What is Redux in the context of React?
Anonymous Quiz
14%
A routing library
16%
A rendering library
59%
A state management library
11%
A data fetching library
🥱2
Find the error in the code.
Difficulty: Average🤨
Difficulty: Average🤨
const numbers = [1, 2, 3, 4, 5];
const doubleNumbers = numbers.map(function(num) {
num *= 2;
});
console.log(doubleNumbers);
What does the typeof operator return for an array?
Anonymous Quiz
10%
list
34%
object
24%
array
32%
array-object
👍2
Which property would you use to animate a change from one set of CSS properties to another?
Anonymous Quiz
25%
transform
31%
keyframes
24%
animation
20%
transition