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
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๐Ÿคจ

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()
Find the error in the code.
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 ๐Ÿ˜

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๐Ÿคจ

const obj1 = { name: 'Alice' };
const obj2 = { name: 'Alice' };

if (obj1 === obj2) {
console.log("true");
} else {
console.log("false");
}
๐Ÿ‘2
Find the error in the code.
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๐Ÿ˜ค

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);
โค5๐Ÿ‘3๐Ÿ”ฅ1๐Ÿ‘1
What will this code output to the console and why?
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
JavaScript Task
Write a function findMax(arr) that takes an array of numbers and returns the largest number in the array.
Difficulty: Easy๐Ÿ˜

function findMax(arr) {

}

console.log(findMax([3, 5, 7, 2, 8]));
How can you apply different styles to a child element when hovering over its parent in CSS?
Anonymous Quiz
44%
parent:hover child { /* styles */ }
17%
parent + hover child { /* styles */ }
27%
child:hover { /* styles */ }
12%
parent > hover child { /* styles */ }
Find the error in the code.
Difficulty: Average๐Ÿคจ

let numbers = [1, 2, 3, 4, 5];

function sumArray(arr) {
return arr.reduce((accumulator, current) => {
return accumulator + current;
}, 0);
}

console.log('Sum:', sumArray(numbers));

numbers = '1, 2, 3, 4, 5';
console.log('Sum:', sumArray(numbers));