Join Now
Home Aptitude Reasoning DI VA GK CA CA Hindi Quiz Placements
To exit the switch statement
To execute the next case
To define a new case
To execute a default case
&&
||
!
All of the above
What is the output of the following code?
var x = "hello";if (x) {console.log("x is truthy");} else {console.log("x is falsy");}
x is truthy
x is falsy
hello is truthy
No output
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
var x;
let x;
const x;
int x;
0
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
What is a conditional statement in JavaScript?
A statement that is always executed
A statement that is executed only if a certain condition is met
A statement that is executed multiple times
A statement that defines a function
To declare a new variable
To define a loop
To execute a block of code based on a condition
To assign a value to a variable
undefined
{}
1