DOM Manipulation in JavaScript
15 questions · 12 min · Medium
Test your knowledge of modern JavaScript features introduced in ES6 and later, including let and const, arrow functions, template literals, destructuring, spread and rest operators, classes, modules, promises, and collections.
No sign-up needed · Last updated:
Score: 0 00:00
Create a free account to keep your scores and track your progress. It is optional.
15 questions · 12 min · Medium
15 questions · 12 min · Medium
15 questions · 12 min · Medium
20 questions · 15 min · Medium
15 questions · 12 min · Medium
15 questions · 12 min · Medium
B. let and const
ES6 introduced let and const, both of which are block-scoped declarations.
C. A const binding cannot be reassigned after initialization
A const declaration creates a binding that cannot be reassigned after initialization.
B. (a, b) => a + b
Arrow functions use the => syntax and can use an expression body for an implicit return.
B. It is lexically inherited from the surrounding scope
Arrow functions do not have their own this binding; they use the this value from their surrounding lexical context.
C. Backticks
Template literals are enclosed in backticks and support embedded expressions using ${...}.
B. ${expression}
Expressions can be embedded inside template literals using the ${expression} syntax.
A. Extract values from an array into variables
Array destructuring provides a concise way to unpack values from arrays into separate variables.
A. const { name, age } = person;
Object destructuring uses curly braces to extract properties from an object.
B. ...
The spread syntax (...) expands iterable elements, such as array elements, into another context.
A. To collect remaining arguments into an array
A rest parameter, written with ..., collects remaining arguments into an array.
B. class
ES6 introduced class syntax for defining classes using the class keyword.
B. export and import
ES modules use export to make bindings available and import to consume exported bindings.
B. Set
A Set stores unique values, meaning duplicate values are not stored as separate entries.
C. Key-value pairs
A Map is a collection of key-value pairs and allows keys of various JavaScript types.
A. Promises
Promises provide an object-based mechanism for representing the eventual completion or failure of an asynchronous operation.