Join Now
Home Aptitude Reasoning DI VA GK CA CA Hindi Quiz Placements
There is no difference between a function declaration and a function expression.
A function declaration is hoisted to the top of the scope, while a function expression is not hoisted.
A function expression is hoisted to the top of the scope, while a function declaration is not hoisted.
A function declaration can only be used inside of an object, while a function expression can be used anywhere.
What is the output of the following code?
console.log("2" * "3");
5
6
23
console.log(2 + 2 + "2");
42
22
221
4
To define a new variable.
To execute a block of code and catch any errors that might occur.
To create a loop.
To exit a function.
console.log(3 + "2");
32
Number
Array
Object
Function
variable name = value;
var name = value;
let name = value;
all of the above
for loop
while loop
do-while loop
if statement
There is no difference between let and var.
let is block-scoped, while var is function-scoped.
var is block-scoped, while let is function-scoped.
let can only be used to declare global variables.
string
number
boolean
object