for (const i of greeting)
to for (const i in greeting)
; n++
after the second sum += value
x.toExponential(4) // '1.667e-3'to
x.toExponential(4) // '1.6667e-3'
'1.667e-3'
to '1.6667e-3'
moonlanding.toLocaleDateString() // '20.7.1969' if the locale is German moonlanding.toLocaleDateString('en-US') // '7/20/1969'to
moonlanding.toLocaleDateString() // '20.7.1969' with German locale and time zone moonlanding.toLocaleDateString('en-US') // '7/20/1969' or '7/21/1969', depending on the time zone
\${\nu\upsilon{
including three backslashes. The second string has two characters:
}}
let minutes = '10:30 - 12:00'.match(/[0-9][0-9](?!:)/g) // ['10, 12']to
let minutes = '10:30 - 12:00'.match(/[0-9][0-9](?!:)/g) // ['30, 00']
map.forEach((key, value) => {
to map.forEach((value, key) => {
firstIndex
/lastIndex
to indexOf
/lastIndexOf
const farr = Float32Array.of(1, 0.5, 0.25, 0.125, 0.0625, 0.03215, 0.015625)to
const farr = Float32Array.of(1, 0.5, 0.25, 0.125, 0.0625, 0.03125, 0.015625)
123,456.78
to 123.456,78
(2x) and switch value: '.'
and value: ','
The Intl.Locale
class provides a way for denoting a locale with certain options:
const usMilitaryTime = new Intl.Locale('en-US', { hourCycle: 'h23' })
Supported options are: language
, script
, region
,
calendar
, collation
, hourCycle
, caseFirst
, numeric
, numberingSystem
.
for (url of urls)
to for (const url of urls)
(2x)Promise.all
:
const [img1, img2] = [await loadImage(url), await loadCatImage()]
encrypt(key)
and decrypt(key)
to encrypt(str)
and decrypt(str)
Function
” to “Every function that is defined with the function
keyword”Symbol.iterable
to Symbol.iterator
for (line of lines(filename)) { if (line.contains(target)) {to
for (const line of lines(filename)) { if (line.includes(target)) {
=>
to the preceding line:
. . .: string }) => leftDelimiter + . . .
pf
can surely accept” to “This assignment is sound because pc
can surely accept”constructor(key: K, second: V)
to constructor(key: K, value: V)
let greeting = 'Hello'to
let greeting: String = 'Hello'
Thanks to Katsutaka Ishibashi, Eran Yarkon, Kunio Yoshikawa and (your name might go here) for their bug reports!
If you have found another bug in the book or in our code that is not mentioned in this bug list, then please send a report. Unfortunately, I cannot reply personally to each report, but I do read all your comments.