JavaScript Task
Remove all empty strings from the array.
Difficulty: Average🤨
Remove all empty strings from the array.
Difficulty: Average🤨
let arr = [1, '', 2, 3, '', 5];
How can you create a flexbox container in CSS?
Anonymous Quiz
6%
display: grid;
81%
display: flex;
9%
display: inline-flex;
4%
display: block;
Which of the following is NOT a valid use of the <meta> tag in HTML?
Anonymous Quiz
8%
Specifying the character encoding of the document
34%
Defining viewport settings for responsive design
47%
Including an external JavaScript file
11%
Providing a denoscription for search engines
Find the error in the code.
Difficulty: Hard😤
Difficulty: Hard😤
function processArray(arr) {
let result = [];
arr.forEach(item => {
if (item != '') {
result.push(item);
} else if (typeof item === 'number') {
result.push(item * 2);
}
});
return result;
}
let data = [1, '', 2, 3, '', 5, null, undefined, 'hello'];
console.log(processArray(data));🤔2
What is the difference between relative and absolute positioning in CSS?
Anonymous Quiz
16%
Relative to viewport; absolute to normal position.
57%
Relative to normal position; absolute to nearest positioned ancestor.
16%
Relative inside flex; absolute outside.
11%
Relative fixes in place; absolute scrolls with page.
How do you handle asynchronous operations in JavaScript?
Anonymous Quiz
18%
Using callbacks
62%
Using async/await
3%
Using Promises
18%
All of the above
JavaScript Task
Display the following pyramid
Difficulty: Average🤨
Display the following pyramid
Difficulty: Average🤨
1
22
333
4444
55555
666666
7777777
88888888
999999999
What is the purpose of the CSS pseudo-class ":first-child"?
Anonymous Quiz
78%
Selects the first child element
6%
Selects an element when it is being clicked
13%
Selects an element when the mouse is over it
3%
Selects the last child element
What is the purpose of the rel="preload" attribute in a <link> tag?
Anonymous Quiz
37%
To load the resource only when it is needed
26%
To request the resource early and prioritize it
15%
To prevent the resource from being loaded
22%
To ensure the resource is cached for offline use
Find the error in the code.
Difficulty: Easy😁
Difficulty: Easy😁
let fruits = ['apple', 'banana', 'orange'];
for (let i = 0; i <= fruits.length; i++) {
console.log(fruits[i]);
}
In React, how do you pass data from a parent component to a child component?
Anonymous Quiz
10%
Using local stage
45%
Using props
38%
Using state management library
7%
Using Redux
Which attribute is used to specify the URL in an img tag?
Anonymous Quiz
72%
src
9%
link
5%
alt
14%
href
JavaScript Task
Fill the array with random numbers from 1 to 100.
Difficulty: Easy😁
Fill the array with random numbers from 1 to 100.
Difficulty: Easy😁
console.log(randomNumbers);
Which method can be used to convert a string to a number?
Anonymous Quiz
13%
parseFloat()
15%
convert()
44%
parseInt()
28%
toNumber()
Which of the following is the correct way to comment in HTML?
Anonymous Quiz
13%
// This is a comment
20%
/* This is a comment */
7%
# This is a comment
61%
<!-- This is a comment -->
Find errors in the code.
Difficulty: Impossible😈
Difficulty: Impossible😈
class User {
constructor(name, age) {
this.name = name;
this.age = age;
}
getProfile() {
return Name: ${name}, Age: ${this.age};
}
isAdult() {
return this.age > 18 ? "Yes" : false;
}
updateProfile(newName, newAge) {
if (newAge < 0) {
throw "Age can't be negative";
}
this.name = newName ?? this.name;
this.age = newAge || this.age;
}
}
const user = new User("John", 25);
console.log(user.getProfile());?2
user.updateProfile("", -5);How can you make a text bold in CSS?
Anonymous Quiz
14%
text-style: bold;
16%
font-style: bold;
2%
font-bold: true;
67%
font-weight: bold;
JavaScript Task
Get an array of letters from this string.
Difficulty: Easy😁
Get an array of letters from this string.
Difficulty: Easy😁
const str = 'abcde';
Which attribute of the <form> tag is used to specify the URL to which the form data will be sent when it is submitted?
Anonymous Quiz
61%
action
17%
method
17%
target
5%
enctype
Find errors in the code.
Difficulty: Average🤨
Difficulty: Average🤨
function bubbleSort(arr) {
let n = arr.length;
for (let i = 0; i < n - 1; i++) {
for (let j = 0; j < n - i - 1; j++) {
if (j > arr[j + 1]) {
let temp = j;
arr[j] = arr[j + 1];
arr[j + 1] = temp;
}
}
}
return arr;
}
const numbers = [64, 34, 25, 12, 22, 11, 90];
const sortedNumbers = bubbleSort(numbers);
console.log("Sorted array:", sortedNumbers);