PRACTICE • LEARN • GROW
Module 10 Final Quiz: Modern JavaScript (ES6+) MCQs
Solve topic-wise placement questions and improve your skills.
Module 10 Final Quiz: Modern JavaScript (ES6+) 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
Which delimiter is used for template literals in JavaScript?
A.
Single quotes ('')
B.
Double quotes ("")
C.
Backticks (``)
D.
Forward slashes (//)
Explanation & Key
Correct Answer:
2
What is the output of the following template literal?
const a = 5, b = 10;
console.log(`Result: ${a + b}`);
A.
'Result: a + b'
B.
'Result: 510'
C.
'Result: 15'
D.
SyntaxError
Explanation & Key
Correct Answer:
3
How do ES Modules (ESM) differ from Node.js CommonJS modules?
A.
CommonJS uses import/export; ESM uses require/module.exports
B.
ESM uses static import/export statements that can be analyzed ahead of time for tree-shaking; CommonJS uses dynamic require() calls
C.
CommonJS is only for client-side browsers
D.
ESM is synchronous while CommonJS is asynchronous
Explanation & Key
Correct Answer:
4
How can you import a module dynamically on-demand inside an async function?
A.
const mod = require(path);
B.
const mod = await import(path);
C.
import mod from path;
D.
loadModule(path);
Explanation & Key
Correct Answer:
5
When are default parameter values in a function evaluated in JavaScript?
A.
At script parse time
B.
At runtime, on each function call if the argument is undefined or omitted
C.
Only once when the file is loaded
D.
During JIT compilation
Explanation & Key
Correct Answer:
6
What does
JSON.stringify() do with object properties whose values are undefined or functions?
A.
Converts them to 'undefined' strings
B.
Omits them completely from the resulting JSON string
C.
Converts them to null
D.
Throws a TypeError
Explanation & Key
Correct Answer:
7
What does the native browser
fetch(url) function return?
A.
A JSON string
B.
A Promise that resolves to a Response object
C.
A XMLHttpRequest instance
D.
An ArrayBuffer
Explanation & Key
Correct Answer:
8
Does
fetch() reject its promise on HTTP 404 Not Found or 500 Server Error status codes?
A.
Yes, it always rejects on 4xx and 5xx status codes
B.
No, it resolves normally; it only rejects on network failures or blocked requests. You must check response.ok or response.status manually!
C.
It only rejects on 500 status
D.
It only rejects on 404 status
Explanation & Key
Correct Answer:
9
How do you parse a JSON body from a Fetch API response object?
A.
response.body()
B.
await response.json()
C.
JSON.parse(response)
D.
response.toObject()
Explanation & Key
Correct Answer:
10
What is a Tagged Template Literal in JavaScript?
A.
A template literal with HTML tags
B.
A function call syntax where a function parses a template literal string array and expression values: tag`hello ${name}`
C.
A template literal with XML tags
D.
A string that cannot be modified
Explanation & Key
Correct Answer:
11
What will be printed?
function test(x = 1, y = 2) {
console.log(x + y);
}
test(null, 5);
A.
6
B.
5
C.
7
D.
NaN
Explanation & Key
Correct Answer:
12
What is the output of the following JSON round-trip?
const a = { date: new Date('2026-01-01') };
const b = JSON.parse(JSON.stringify(a));
console.log(typeof b.date);
A.
'object'
B.
'string'
C.
'number'
D.
'undefined'
Explanation & Key
Correct Answer:
Question Palette
Answered
Current
Not Attempted
Wrong