W3Tutorials.net
Toggle Menu
Home
Online Go Compiler
Tutorials
Javascript Tutorials
Python Tutorials
Go Tutorials
Blog
All Posts
JavaScript ES6+ Features
Assess your grasp of modern JavaScript syntax and features.
1. Which ES6 keyword is used to declare block-scoped variables that cannot be reassigned?
var
let
const
2. Which of the following are characteristics of arrow functions in ES6?
Shorter syntax than traditional function expressions
Binds its own 'this' context
Has an 'arguments' object
Cannot be used as a constructor
3. Template literals in ES6 use backticks (`) for string interpolation.
True
False
4. What is the abbreviation for the ES6 feature that spreads elements of an iterable into arrays or function arguments?
5. Which ES6 feature allows extracting values from arrays or objects into distinct variables?
Destructuring assignment
Spread operator
Rest parameter
Template literals
6. Which of the following are part of ES6 module syntax?
import
export
require
module.exports
7. The 'async/await' syntax was introduced in ES6 (2015).
True
False
8. What is the output of `[1, 2, 3].map(x => x * 2)`?
9. In ES6, how do you set a default value for a function parameter?
function foo(x = 5) {}
function foo(x: 5) {}
function foo(x == 5) {}
function foo(x || 5) {}
10. Which of the following are valid features of ES6 classes?
Constructor method
Extends keyword for inheritance
Private methods (using # syntax)
Static methods
11. The rest parameter syntax (...) collects remaining function arguments into an array.
True
False
12. What keyword is used to create a subclass that inherits from a parent class in ES6?
13. Which method is used to handle the successful resolution of a Promise in ES6?
.then()
.catch()
.finally()
.resolve()
14. Which limitations apply to arrow functions in ES6?
Cannot be used as constructors (with 'new')
No prototype property
Cannot be used as generator functions (with '*')
Can access 'super' keyword
15. ES6 introduced the 'Set' data structure, which stores unique values.
True
False
Reset
Answered 0 of 0 — 0 correct