getify / You-Dont-Know-JS

A book series on JavaScript. @YDKJS on twitter.
Other
179.24k stars 33.48k forks source link

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

Closed yg-i closed 11 months ago

yg-i commented 11 months ago

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
getify commented 11 months ago

Eh. Seems irrelevant.