You can prepare effectively for Software Development JavaScript for Web Development with this dedicated MCQ Practice Test (available with solutions) on the important topic of "Test: Functions - 2". These 15 questions have been designed by the experts with the latest curriculum of Software Development 2026, to help you master the concept.
Test Highlights:
Sign up on EduRev for free to attempt this test and track your preparation progress.
Detailed Solution: Question 1
What is the difference between parameters and arguments in JavaScript?
Detailed Solution: Question 2
Which of the following statements is true regarding JavaScript functions?
Detailed Solution: Question 3
What is the purpose of the 'return' statement in JavaScript functions?
Detailed Solution: Question 4
Detailed Solution: Question 5
What will be the output of the following code?
function greet() {
console.log("Hello!");
}
console.log(typeof greet);
Detailed Solution: Question 6
What will be the output of the following code?
function sum(a, b) {
return a + b;
}
var result = sum(3, 4);
console.log(result);
Detailed Solution: Question 7
What will be the output of the following code?
function outer() {
var x = 10;
function inner() {
console.log(x);
}
return inner;
}
var fn = outer();
fn();
Detailed Solution: Question 8
What will be the output of the following code?
var x = 5;
function test() {
console.log(x);
var x = 10;
}
test();
Detailed Solution: Question 9
What will be the output of the following code?
function multiply(a, b = 2) {
return a * b;
}
console.log(multiply(3));
Detailed Solution: Question 10
What will be the output of the following code?
var x = 10;
function outer() {
function inner() {
console.log(x);
}
inner();
var x = 20;
}
outer();
Detailed Solution: Question 11
What will be the output of the following code?
function greet(name) {
console.log("Hello, " + name + "!");
}
greet();
Detailed Solution: Question 12
What will be the output of the following code?
function outer() {
var x = 10;
function inner() {
console.log(x);
}
x = 20;
return inner;
}
var fn = outer();
fn();
Detailed Solution: Question 13
What will be the output of the following code?
var x = 10;
function test() {
if (x === 10) {
var x = 20;
}
console.log(x);
}
test();
Detailed Solution: Question 14
What will be the output of the following code?
function add(a, b) {
return a + b;
}
function multiply(a, b) {
return a * b;
}
var result = add(2, multiply(3, 4));
console.log(result);
Detailed Solution: Question 15
51 videos|32 docs|12 tests |