Which statement is used to execute a function in JavaScript?
Anonymous Quiz
18%
run
47%
function
7%
execute
29%
call
Which of the following is NOT a valid JavaScript variable name?
Anonymous Quiz
9%
myVariable
53%
2ndVariable
29%
$variable
9%
_variable
Find the error in the code.
Difficulty: Average๐
Difficulty: Average๐
const data = [1, 2, 3, 4, 5];
function getEvenNumbers(arr) {
return arr.filter(num => num % 2 = 0);
}
console.log(getEvenNumbers(data));
๐4โค2๐ฅ2
What does the :nth-child() pseudo-class do in CSS?
Anonymous Quiz
24%
It applies styles to every child element of a specific type
41%
it selects elements based on their index among siblings
18%
it selects the first child element of a specific type
18%
it selects elements based on their parents
The task is to write a palindrome function.
Difficulty: Hard๐ค
Difficulty: Hard๐ค
isPalindrome("radar"); // true
isPalindrome("hello"); // falseWhat is the purpose of the "If" statement in JavaScript?
Anonymous Quiz
69%
To execute a block of code conditionally
9%
To define a function
14%
To create a loop
9%
To declare a variable
What is the "useState" hook in React used for?
Anonymous Quiz
20%
To define component style
17%
To manage global state
7%
To create routing in React
57%
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
12%
To define component style
35%
To manage global state
19%
To create routing in React
35%
To fetch data from external APIs
โคโ๐ฅ1๐1๐1
What does the "margin: 0 auto;" CSS rule do?
Anonymous Quiz
21%
Adds a 0-pixel margin at the top and bottom
18%
Removes all margins from an element
52%
Centers an element horizontally within its container
9%
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
32%
<list>
30%
<dl>
18%
<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);