JavaScript From Beginner To Advanced

0% completed

Previous
Next
Quiz
What does the following function output when called as 'printNumbers(1, 2, 3, 4, 5)'?
function printNumbers(...nums) {
    console.log(nums.length);
}
A
5
B
[1, 2, 3, 4, 5]
C
undefined
D
Error
What is printed by the following code snippet?
const largeNumber = BigInt(9007199254740991) + BigInt(2);
console.log(largeNumber);
A
9007199254740993n
B
9007199254740993
C
TypeError
D
SyntaxError
Which operator is used in JavaScript to conditionally assign a value based on another expression's truthiness?
A
?:
B
&&
C
||
D
??
What is immediately printed by the following self-invoking function?
(function() {
    console.log("Hello, world!");
})();
A
Hello, world!
B
undefined
C
()
D
Nothing is printed
Given the following curried function, what does multiply(2)(3) return?
function multiply(a) {
    return function(b) {
        return a * b;
    };
}
A
6
B
5
C
function
D
undefined
What is the result of executing the following code?
console.log(num);
var num = 10;
console.log(num);
A
undefined and 10
B
10 and 10
C
ReferenceError
D
0 and 10

.....

.....

.....

Like the course? Get enrolled and start learning!
Previous
Next