Programming Quiz Channel
724 subscribers
81 photos
4 videos
1 file
Programming quizzes and knowledge tests

Short quizzes on programming, logic and computer science.

Test and improve your coding knowledge.
Join 👉 https://rebrand.ly/bigdatachannels

DMCA: @disclosure_bds
Contact: @mldatascientist
Download Telegram
Find the error in the code.
Difficulty: Easy🙂

let user = {
name: "John"
age: 30,
isAdmin: true
};

console.log("User's name is: " + user.name);
Which HTML tag is used to define an unordered list?
Anonymous Quiz
16%
<ol>
10%
<li>
66%
<ul>
9%
<dl>
What will this code output?
Difficulty: Average😐

let x = 0.1 + 0.2;
let y = 0.3;

if (x === y) {
console.log("Values are equal");
} else {
console.log("Values are not equal");
}
Can negative values be allowed in padding property?
Anonymous Quiz
43%
Yes
17%
Depends
36%
No
4%
None of the above
Which HTML tag is used to create a numbered list?
Anonymous Quiz
14%
<ul>
25%
<li>
55%
<ol>
5%
<dl>
What will this code output? Spot the bug.
Difficulty: Hard😤

for (var i = 0; i < 5; i++) {
setTimeout(function() {
console.log(i);
}, 1000);
}
What type of language is JavaScript?
Anonymous Quiz
67%
Object-oriented
14%
Procedural
10%
Markup
10%
Assembly
Find the error in the code.
The answer should be: 15
Difficulty: Average😐

function sumArray(arr) {
let sum = 0;
arr.forEach(function(num) {
sum =+ num;
});
return sum;
}

let numbers = [1, 2, 3, 4, 5];
console.log(sumArray(numbers));
Which CSS property is used to control the transparency of an element?
Anonymous Quiz
38%
transparent
33%
opacity
18%
visibility
11%
transparency
👍31🔥1
How can the code be modified to handle both successful and failed promises?
Difficulty: Impossible😈

const promises = [
Promise.resolve(1),
Promise.reject(new Error('Error'))
];

Promise.all(promises)
.then(results => console.log(results))
.catch(error => console.error(error));
Which CSS property is used to make text bold?
Anonymous Quiz
53%
font-weight
22%
text-weight
22%
bold
2%
font-style
Which HTML tag is used to create a horizontal line?
Anonymous Quiz
11%
<line>
73%
<hr>
11%
<horizontal>
4%
<b>
TEST
Write a calculator in JavaScript with minimal code
Difficulty: Easy🙂

function calculate(expression) {
try {
let result = eval(expression);
if (isNaN(result)) {
throw new Error("Invalid expression");
}
return result;
} catch (e) {
return "Error: " + e.message;
}
}

let userInput = prompt("Enter an arithmetic expression (for example, 2 + 2):");

if (userInput !== null) {
console.log("Result:", calculate(userInput));
}
How can you select all the elements with class "example" in CSS?
Anonymous Quiz
18%
*example
69%
.example
5%
example.example