ArtOfCode.org
Toggle Menu
Home
Online Rust Compiler
Tutorials
Algorithms 101
Html Css Tutorial
Javascript Tutorial
Blog
All Posts
JavaScript ES6 and Beyond
Recall modern syntax and features.
1. Which keyword was introduced in ES6 for block-scoped variable declaration?
var
let
function
2. Which of the following features were introduced in ES6?
Arrow functions
Destructuring assignment
Template literals
var keyword
3. ES6 introduced the 'class' keyword to enable object-oriented programming in JavaScript.
True
False
4. What symbol is used to define template literals in ES6?
5. How does an arrow function differ from a traditional function expression in terms of 'this' binding?
Arrow functions have their own 'this' binding
Arrow functions lexically inherit 'this' from their surrounding context
Arrow functions bind 'this' to the global object
Arrow functions do not have a 'this' binding
6. Which of these are valid uses of the spread operator (...) in ES6?
Copying an array: const newArr = [...oldArr];
Merging objects: const merged = { ...obj1, ...obj2 };
Defining a rest parameter: function sum(...nums) { ... }
String interpolation: `Hello ${name}`
7. ES6 modules use 'import' and 'export' statements to share code between files.
True
False
8. What ES6 feature allows functions to have parameters with predefined values if not provided?
9. Which method is used to handle errors in a Promise chain?
.then()
.catch()
.finally()
.resolve()
10. Which features were introduced in ES2017 (ES8) or later (beyond ES6)?
Async/await syntax
Array.prototype.includes()
Optional chaining operator (?.)
Object.values()
Reset
Answered 0 of 0 — 0 correct