Skip to content

Files

Section18-ES2016-and-ES2017

Section 18- ES2016 and ES2017

Section slides

ES2016 new features:

  • Exponentiation Operator **

    Example:
    Another example:
  • [].includes

ES2017 new features

  • padStart

    The LeftPad (padStart) Debacle

    • The first parameter is the total length of the new string
    • The second parameter is what to pad with from the start. The default is an empty space
  • padEnd

    • The first parameter is the total length of the new string
    • The second parameter is what to pad with from the end. The default is an empty space
  • ES2017 Async Functions

    • A special kind of function that is created using the word async
    • The purpose of async functions is to simplify writing asynchronous code, specifically Promises.


    • What makes them really special is the await keyword!