📜

JavaScript: ES6+ Features

110 cards · 🇺🇸 English

Modern JavaScript syntax: let/const, arrow functions, destructuring, and more.

Study all 110 cards for free

Flashcards, quizzes, pixel-art games and a daily review that remembers for you.

Study this deck free

Try the first 10 cards

1 / 10
Question

let vs var

Knew itLearning

Tap the card for the answer · swipe right if you knew it, left if not

Already have an account? Sign in

Cards

  1. 1let vs var
    let has block scope and cannot be redeclared, while var has function scope and can be redeclared
  2. 2What does const declare?
    A constant reference that cannot be reassigned (but the value itself may be mutable for objects/arrays)
  3. 3Arrow function
    A concise function syntax using => that lexically binds this
  4. 4Template literal syntax
    String literals using backticks (``) that allow embedded expressions with ${}
  5. 5Array destructuring
    Syntax to unpack array values into distinct variables: const [a, b] = [1, 2]
  6. 6Object destructuring
    Syntax to extract properties from objects: const {name, age} = person
  7. 7Spread operator for arrays
    ... operator that expands array elements: [...arr1, ...arr2]
  8. 8Rest parameter syntax
    ...args syntax that collects remaining function arguments into an array
  9. 9Default parameter
    A function parameter with a default value: function(x = 10)
  10. 10Object property shorthand
    Concise syntax for object properties when key and variable name match: {name} instead of {name: name}
  11. 11Computed property name syntax
    Using expressions as object keys with brackets: {[key]: value}
  12. 12Class in ES6
    Syntactic sugar over prototype-based inheritance using class keyword
  13. 13Constructor method in a class
    Special method for creating and initializing class instances
  14. 14Class inheritance syntax
    Using extends keyword: class Child extends Parent
  15. 15Super keyword
    Calls parent class constructor or methods from a child class
  16. 16Static method
    A method called on the class itself, not on instances: static methodName()
  17. 17Promise
    An object representing eventual completion or failure of an asynchronous operation
  18. 18Three Promise states
    pending, fulfilled, rejected
  19. 19Promise.then()
    Method to handle fulfilled Promise with a callback function
  20. 20Promise.catch()
    Method to handle rejected Promise with an error handler
  21. 21Async keyword
    Declares an asynchronous function that returns a Promise
  22. 22Await keyword
    Pauses async function execution until Promise resolves, returns the resolved value
  23. 23ES6 module export syntax
    export keyword to make functions/variables available: export const foo = 1
  24. 24Default export
    Export a single default value from a module: export default MyClass
  25. 25ES6 module import syntax
    import keyword to use exported values: import {foo} from './module'
  26. 26For...of loop
    Loop that iterates over iterable objects (arrays, strings, etc.): for (const item of array)
  27. 27for...of vs for...in
    for...of iterates values, for...in iterates keys/indices
  28. 28Map in ES6
    A collection of keyed data items allowing any data type as key
  29. 29Set in ES6
    A collection of unique values (no duplicates)
  30. 30WeakMap
    A Map where keys must be objects and are weakly referenced (can be garbage collected)

And 80 more cards. Study the whole deck free

Articles about this deck

More Programming decks

See all
Study all 110 cards free