TutorialPedia.org
Toggle Menu
Home
Online Go Compiler
Tutorials
JavaScript Tutorials
Golang Tutorials
Linux Command Line Tutorials
Blog
All Posts
JavaScript ES6+ Features
Assess your knowledge of modern JavaScript features like arrow functions,destructuring,and modules.
1. Which keyword is used for block-scoped variable declaration in ES6?
var
let
function
2. Which of the following features were introduced in ES6 (2015)?
Arrow functions
async/await
Destructuring assignment
Optional chaining (?.)
3. Arrow functions have their own 'this' binding.
True
False
4. What characters are used to enclose template literals in ES6?
5. Which operator is used for the rest parameter syntax in ES6?
*
&
...
#
6. Which of these are valid uses of destructuring assignment in ES6?
Array destructuring
Object destructuring
Function parameter destructuring
Class destructuring
7. const declarations create immutable values.
True
False
8. What is the output of `[1, 2, 3].find(x => x > 2)`?
9. Which ES6 feature allows specifying default values for function parameters?
Rest parameters
Default parameters
Spread parameters
Optional parameters
10. Which array methods were introduced in ES6?
find()
map()
entries()
filter()
11. The spread operator (...) can be used to merge two arrays.
True
False
12. What keyword is used to export a default value from an ES6 module?
13. What does the 'import' statement do in ES6 modules?
Declares a constant variable
Loads and uses functionality from another module
Defines a new function
Creates an object
14. Which of the following are features of ES6 classes?
Constructor method
Prototype methods
Static methods
Private fields (#)
15. ES6 introduced the 'Promise' object for asynchronous operations.
True
False
16. What is the output of `const {x=10} = {x: undefined}; console.log(x)`?
17. Which ES6 feature provides a concise syntax for writing function expressions?
Generator functions
Arrow functions
Async functions
Function declarations
18. Which of the following are valid ways to declare an ES6 class?
class MyClass {}
const MyClass = class {}
class MyClass extends OtherClass {}
function MyClass() {}
19. Optional chaining (?.) was introduced in ES6.
True
False
20. What operator is used for nullish coalescing in ES2020 (a post-ES6 feature)?
Reset
Answered 0 of 0 — 0 correct