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);
Which JavaScript method is used to create a new instance of a Date object?
Anonymous Quiz
17%
Date.create()
46%
new Date()
10%
Date()
27%
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
45%
margin
11%
border-spacing
28%
padding
15%
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
11%
<n>
8%
<navigate>
12%
<section>
69%
<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
13%
A routing library
18%
A rendering library
59%
A state management library
10%
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
9%
list
34%
object
23%
array
33%
array-object
๐2
Which property would you use to animate a change from one set of CSS properties to another?
Anonymous Quiz
25%
transform
30%
keyframes
25%
animation
20%
transition
What will this code output to the console and why?
Difficulty: Hard๐ค
Difficulty: Hard๐ค
function addToArray(arr, value) {
arr.push(value);
return arr;
}
const numbers = [1, 2, 3];
const result = addToArray(numbers, 4);
console.log(result);
console.log(numbers);What is the purpose of the <!DOCTYPE html> declaration?
Anonymous Quiz
19%
To define the encoding of the document
69%
To specify the document type and version of HTML
6%
To include external JavaScript files
5%
To specify the base URL for relative links
๐2
How do you create a comment in a CSS file?
Anonymous Quiz
38%
<!-- This is a comment -->
13%
// This is a comment
43%
/* This is a comment */
6%
# This is a comment
โค5๐3๐ฅ1๐1
What will this code output to the console and why?
Difficulty: Average๐คจ
Difficulty: Average๐คจ
function createAccumulator(initialValue) {
let total = initialValue;
return function(amount) {
total += amount;
return total;
};
}
const accumulator = createAccumulator(10);
console.log(accumulator(5));
console.log(accumulator(10));
console.log(accumulator(-5));
const anotherAccumulator = createAccumulator(100);
console.log(anotherAccumulator(50));๐3โค2๐ค1
Which of the following is true about let and var in JavaScript?
Anonymous Quiz
15%
var is block-scoped, while let is function-scoped
28%
let is function-scoped, while var is block-scoped
20%
Both let and var are block-scoped
37%
let is block-scoped, while var is function-scoped