getify / You-Dont-Know-JS

A book series on JavaScript. @YDKJS on twitter.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Promise.prototype.finally was introduced in ES2018, not E2019

yg-i opened this issue · comments

commented

Please type "I already searched for this issue":
I already searched for this issue

Edition: (1st or 2nd)
2nd

Book Title:
Getting Started

Chapter:
1

Section Title:
Filling the Gaps

Problem:
Re: the sentences

This code uses an ES2019 feature, the finally(..) method on the promise prototype. If this code were used in a pre-ES2019 environment, the finally(..) method would not exist, and an error would occur.

it seems that Promise.prototype.finally() was introduced in ES2018, not ES2019. See e.g.

  1. ES2018 spec: https://262.ecma-international.org/9.0/#sec-promise.prototype.finally
  2. contemporaneous references: 1 2

Eh. Seems irrelevant.