Practice javascript Quizzes
Explore javascript in depth with quizzes covering fundamentals to advanced concepts. DevBrainiac's structured quiz format helps you understand theory, apply logic and master problem-solving techniques. With continuous practice, you can track progress, fix mistakes and build strong command of javascript.
Explore All javascript Quizzes
Learn javascript step by step with interactive quizzes designed for beginners and learners revising key concepts. Build a strong foundation with clear, structured practice in javascript.
Question 1
What will be the output of the following code?
console.log(0.1 + 0.2 === 0.3);
1
TypeError
2
false
3
true
4
undefined
Question 2
What will be the output of the following code?
let x = {};
let y = x;
console.log(x === y);1
ReferenceError
2
true
3
undefined
4
false
Question 3
Which of the following is NOT a valid way to declare a JavaScript variable?
1
let x = 10;
2
const x = 10;
3
int x = 10;
4
var x = 10;
Question 4
What will be the output of the following code?
function test() {
console.log(a);
var a = 10;
}
test();1
ReferenceError
2
undefined
3
TypeError
4
10
Question 5
What will be the output of the following code?
function test() {
console.log(a);
let a = 10;
}
test();1
10
2
ReferenceError
3
undefined
4
TypeError
Question 6
What will be the output of the following code?
console.log(typeof null);
1
object
2
undefined
3
null
4
function
Question 7
What will be the output of the following code?
let a = [1, 2, 3]; let b = a; b.push(4); console.log(a);
1
ReferenceError
2
[1, 2, 3]
3
[1, 2, 3, 4]
4
TypeError
Question 8
What will be the output of the following code?
console.log(3 + "3");
1
TypeError
2
NaN
3
33
4
3
Question 9
What will be the output of the following code?
console.log([] == ![]);
1
TypeError
2
ReferenceError
3
true
4
false
Question 10
What will be the output of the following code?
(function() {
var x = 5;
})();
console.log(x);1
undefined
2
ReferenceError
3
5
4
TypeError
Question 11
Which statement is true for let and var in JavaScript?
1
Both are block-scoped
2
var is function-scoped, and let is block-scoped
3
Both are function-scoped
4
let is function-scoped, and var is block-scoped
Question 12
What will be the output of this code?
const fun = function(){
if (true) {
var x = 10;
let y = 20;
console.log(x);
}
console.log(x);
}
fun();1
10
2
10 10
3
TypeError
4
ReferenceError
Question 13
What will be the output of this code?
const fun = function(){
if (true) {
var x = 10;
let y = 20;
console.log(y);
}
console.log(y);
}
fun();1
20 20
2
ReferenceError
3
TypeError
4
20 ReferenceError: y is not defined
Question 14
What will be the output of this code?
const fun = function(){
if (true) {
var x = 10;
let y = 20;
console.log(x);
}
console.log(x);
}
fun();
console.log(x);1
10 ReferenceError: x is not defined
2
ReferenceError: x is not defined
3
10 10 10
4
10 10 ReferenceError: x is not defined
Question 15
In JavaScript, which method is used to get the Unicode of a character?
1
asciiCodeAt()
2
codeAt()
3
charCodeAt()
4
getCode()
Question 16
What is the value of '1' + 1 in JavaScript?
1
NaN
2
2
3
TypeError
4
11
Question 17
In a doubly linked list containing nodes A ↔ B ↔ C ↔ D ↔ E ↔ F, if a pointer p points to node E, then what does p.previous.next refer to?
1
F
2
E
3
D
4
A
