PRACTICE • LEARN • GROW
Module 3 Final Quiz: Functions MCQs
Solve topic-wise placement questions and improve your skills.
Module 3 Final Quiz: Functions Progress
0 of 12 completed
0%
Topic Track
You are viewing MCQs in preview mode. Log in to select options, submit answers, and track your progress.
Log In to Answer
1
Why are functions called 'first-class citizens' in JavaScript?
A.
Because they can only run in the browser's main thread
B.
Because they are treated like any other value: can be assigned to variables, passed as arguments, and returned from functions
C.
Because they execute before any other language construct
D.
Because they have priority in the call stack
Explanation & Key
Correct Answer:
2
Which of the following is true regarding arrow functions (=>)?
A.
They have their own dynamic 'this' binding
B.
They do not have their own 'this' and instead inherit 'this' lexically from the surrounding scope
C.
They can be used as constructors with 'new'
D.
They possess an internal 'arguments' object
Explanation & Key
Correct Answer:
3
What is the correct syntax for an arrow function that returns an object literal implicitly?
A.
() => { id: 1 }
B.
() => ({ id: 1 })
C.
() => [ id: 1 ]
D.
() => return { id: 1 }
Explanation & Key
Correct Answer:
4
What is the Call Stack in the JavaScript engine?
A.
A FIFO queue holding pending network requests
B.
A LIFO stack data structure that tracks function execution contexts and active return frames
C.
A heap memory area where global variables are stored
D.
A browser rendering engine component
Explanation & Key
Correct Answer:
5
What error is thrown when infinite recursion exhausts the call stack?
A.
OutOfMemoryError
B.
RangeError: Maximum call stack size exceeded
C.
StackOverflowException
D.
TypeError
Explanation & Key
Correct Answer:
6
What is a closure in JavaScript?
A.
A function that immediately terminates the browser tab
B.
The combination of a function bundled with references to its surrounding lexical environment, retaining access to outer variables
C.
A private object method that cannot return values
D.
An arrow function without parameters
Explanation & Key
Correct Answer:
7
What will be printed by this closure counter?
function makeCounter() {
let count = 0;
return () => ++count;
}
const c1 = makeCounter();
const c2 = makeCounter();
c1();
console.log(c1(), c2());
A.
2 1
B.
2 2
C.
1 1
D.
3 1
Explanation & Key
Correct Answer:
8
What will be printed by this method invocation?
const obj = {
name: 'Codex',
show() {
console.log(this.name);
}
};
const fn = obj.show;
fn();
A.
'Codex'
B.
undefined (or window.name in non-strict browser)
C.
TypeError
D.
ReferenceError
Explanation & Key
Correct Answer:
9
What does
Function.prototype.bind() return?
A.
The immediate return value of the function
B.
A new copy of the function with its 'this' permanently bound to the provided object
C.
A Promise
D.
An array of arguments
Explanation & Key
Correct Answer:
10
What is the output of the following snippet?
const user = {
name: 'Sam',
greet: () => {
console.log(this.name);
}
};
user.greet();
A.
'Sam'
B.
undefined
C.
TypeError
D.
ReferenceError
Explanation & Key
Correct Answer:
11
How does
func.apply(thisArg, [args]) differ from func.call(thisArg, ...args)?
A.
call accepts arguments as an array, apply accepts comma-separated arguments
B.
apply accepts arguments as an array, call accepts individual comma-separated arguments
C.
apply returns a Promise, call does not
D.
call can only be used with arrow functions
Explanation & Key
Correct Answer:
12
What will happen if you attempt to re-bind an arrow function using
.bind()?
A.
It updates the 'this' context normally
B.
It throws a TypeError
C.
The call is silently ignored; arrow functions permanently retain their original lexical 'this'
D.
It converts the arrow function to a regular function
Explanation & Key
Correct Answer:
Question Palette
Answered
Current
Not Attempted
Wrong