Join Now
Home Aptitude Reasoning DI VA GK CA CA Hindi Quiz Placements
What is the output of the following code?
var x = 10;var y = "10";if (x === y) {console.log("x is equal to y");} else {console.log("x is not equal to y");}
x is equal to y
x is not equal to y
undefined
Error
switch (x) {
switch (x == 10) {
switch x {
switch (x === "10") {
0
{}
1
+
/
&&
%
What is the value of x after the following code is executed:
var x = 10;if (x < 5) {x = x + 5;} else if (x < 15) {x = x + 10;} else {x = x + 15;}console.log("Value of x is", x);
15
20
25
30
null
hello
var x = "10";var y = 10;if (x == y) {console.log("x and y are equal");} else {console.log("x and y are not equal");}
x and y are equal
x and y are not equal
10 and 10 are equal
No output
var x = 10;var y = 20;var z = x > y ? "x is greater than y" : "y is greater than x";console.log(z);
x is greater than y
y is greater than x
var x = "10";var y = 10;if (x === y) {console.log("x and y are equal");} else {console.log("x and y are not equal");}
To exit the switch statement
To execute the next case
To define a new case
To execute a default case