LogIn
I don't have account.
Question 1
What will be the output of the following code?
console.log(0.1 + 0.2 === 0.3);
1
true
2
TypeError
3
undefined
4
false
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
int x = 10;
3
const 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
undefined
2
TypeError
3
10
4
ReferenceError
Question 5
What will be the output of the following code?
function test() {
  console.log(a);
  let a = 10;
}
test();
1
ReferenceError
2
undefined
3
TypeError
4
10
Question 6
What will be the output of the following code?
console.log(typeof null);
1
object
2
null
3
undefined
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
[1, 2, 3]
2
TypeError
3
ReferenceError
4
[1, 2, 3, 4]
Question 8
What will be the output of the following code?
console.log(3 + "3");
1
NaN
2
33
3
TypeError
4
3
Question 9
What will be the output of the following code?
console.log([] == ![]);
1
TypeError
2
false
3
ReferenceError
4
true
Question 10
What will be the output of the following code?
(function() {
  var x = 5;
})();
console.log(x);
1
undefined
2
5
3
TypeError
4
ReferenceError
Question 11
Which statement is true for let and var in JavaScript?
1
Both are block-scoped
2
Both are function-scoped
3
let is function-scoped, and var is block-scoped
4
var is function-scoped, and let 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
ReferenceError
2
10
3
10 10
4
TypeError
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
ReferenceError
2
20
20
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
10
ReferenceError: x is not defined
2
10
ReferenceError: x is not defined
3
10
10
10
4
ReferenceError: x is not defined
Question 15
In JavaScript, which method is used to get the Unicode of a character?
1
codeAt()
2
charCodeAt()
3
asciiCodeAt()
4
getCode()
Question 16
What is the value of '1' + 1 in JavaScript?
1
2
2
11
3
NaN
4
TypeError
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
D
2
A
3
E
4
F