PRACTICE • LEARN • GROW
Module 8 Final Quiz: Object-Oriented JavaScript MCQs
Solve topic-wise placement questions and improve your skills.
Module 8 Final Quiz: Object-Oriented JavaScript 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
How does prototypal inheritance differ from classical class-based inheritance?
A.
Prototypal inheritance compiles classes into C++ structs
B.
Objects link directly to other objects via an internal prototype link rather than instantiating abstract class blueprints
C.
Prototypal inheritance does not allow method reuse
D.
Classes in JavaScript do not use prototypes
Explanation & Key
Correct Answer:
2
What object sits at the very top of the prototype chain in JavaScript?
A.
Function.prototype
B.
Object.prototype (whose own __proto__ is null)
C.
window
D.
Class.prototype
Explanation & Key
Correct Answer:
3
What will be printed by this prototypal lookup?
const parent = { greet: 'Hello' };
const child = Object.create(parent);
child.greet = 'Hi';
console.log(child.greet, parent.greet);
A.
'Hi' 'Hi'
B.
'Hi' 'Hello'
C.
'Hello' 'Hello'
D.
undefined 'Hello'
Explanation & Key
Correct Answer:
4
What are ES6 classes under the hood in JavaScript?
A.
Native bytecode compiled classes
B.
Syntactic sugar layered on top of JavaScript's existing prototypal inheritance system
C.
Java Virtual Machine bytecode wrappers
D.
A completely new object model that replaced prototypes
Explanation & Key
Correct Answer:
5
What is the requirement when creating a constructor in a derived subclass with
extends?
A.
super() must be called before accessing 'this'
B.
The constructor must return a Promise
C.
It cannot have parameters
D.
super() is forbidden
Explanation & Key
Correct Answer:
6
How are private class fields denoted in modern JavaScript (ES2022+)?
A.
With the 'private' keyword: private x = 10;
B.
With a hash prefix: #x = 10;
C.
With an underscore: _x = 10;
D.
With Symbol(x)
Explanation & Key
Correct Answer:
7
What does the
static keyword on a class method signify?
A.
The method cannot be overridden
B.
The method belongs to the class constructor itself and is called as ClassName.method(), not on instances
C.
The method is private
D.
The method executes only once
Explanation & Key
Correct Answer:
8
What does
dog instanceof Animal evaluate?
A.
Checks if dog was created in the Animal.js file
B.
Checks if Animal.prototype appears anywhere in dog's prototype chain
C.
Checks if dog has the exact same properties as Animal
D.
Checks whether dog is a primitive
Explanation & Key
Correct Answer:
9
What is the output of the following inheritance snippet?
class A {
say() { return 'A'; }
}
class B extends A {
say() { return super.say() + 'B'; }
}
console.log(new B().say());
A.
'B'
B.
'AB'
C.
'A'
D.
TypeError
Explanation & Key
Correct Answer:
10
What method checks if a property belongs directly to an object rather than inherited from its prototype?
A.
obj.hasPrototypeProperty(prop)
B.
Object.hasOwn(obj, prop) or obj.hasOwnProperty(prop)
C.
prop in obj
D.
typeof obj[prop] !== 'undefined'
Explanation & Key
Correct Answer:
11
What is the prototype of a plain object literal
{}?
A.
null
B.
Object.prototype
C.
Function.prototype
D.
undefined
Explanation & Key
Correct Answer:
12
What will happen if you access a property that exists on neither the object nor any prototype in its chain?
A.
Throws a ReferenceError
B.
Returns undefined
C.
Returns null
D.
Throws a TypeError
Explanation & Key
Correct Answer:
Question Palette
Answered
Current
Not Attempted
Wrong