Errata
The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".
The following errata were submitted by our customers and approved as valid errors by the author or editor.
Color key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update
Version | Location | Description | Submitted By | Date submitted | Date corrected |
---|---|---|---|---|---|
Page https://learning.oreilly.com/library/view/learning-typescript/9781098110321/ch09.html#idm45584679661 https://learning.oreilly.com/library/view/learning-typescript/9781098110321/ch09.html#idm45584679661808 |
function getRating(ratings: Ratings, key: 'audience' | 'critic'): number { Note from the Author or Editor: |
Anonymous | Jun 10, 2022 | Jul 01, 2022 | |
Page Arrays : Union-Type Arrays First code example under the Union-Type Arrays sections |
Here's the excerpt from the book Note from the Author or Editor: |
Wale | Jul 13, 2022 | Aug 26, 2022 | |
Page Ch 02. Type Shapes https://learning.oreilly.com/library/view/learning-typescript/9781098110321/ch02.html#:-:text=TypeScript%20knows%20the,key%20and%20complains%3A |
The text talks about "birthNames" object, but the object declared in the snippet below that is "cher", and there is no reference to "birthNames" anywhere in that mini-section. I guess we need to replace "birthNames" with "cher" or the other way around (rename "cher" in the code snippet to "birthNames"). Note from the Author or Editor: |
Anonymous | Jul 23, 2022 | Aug 26, 2022 | |
Page Ch05 Functions | Function types https://learning.oreilly.com/library/view/learning-typescript/9781098110321/ch05.html#:-:text=logSongs%3A%20(strong%3A%20string) |
"logSongs: (strong: string)" should be Note from the Author or Editor: |
Anonymous | Jul 27, 2022 | Aug 26, 2022 | |
Page Ch05 Functions | Function types https://learning.oreilly.com/library/view/learning-typescript/9781098110321/ch05.html#:-:text=song%E2%80%99s%20number%20type%20is%20not%20assignable%20to%20index%E2%80%99s%20string%20type |
"song’s number type is not assignable to index’s string type" should be Note from the Author or Editor: |
Anonymous | Jul 27, 2022 | Aug 26, 2022 | |
Page Interface Extensions https://learning.oreilly.com/library/view/learning-typescript/9781098110321/ch07.html#:-:text=extraProperty |
Error states Note from the Author or Editor: |
Ryan C | Aug 14, 2022 | Aug 26, 2022 | |
Page p136 In the "Assertions versus declarations" code example |
In the type error for the `const declared: Entertainer` expression, it mentions " Error: Property 'acts' is missing in type '{ one: number; }' but required in type 'Entertainer'.". That object should be `{ name: string; }` instead. Note from the Author or Editor: |
David Brownman | Oct 17, 2022 | May 05, 2023 | |
Page Page 89 Code example |
In the code sample, it says that the following should throw an error becasue "Property 'author' is missing in type..." Note from the Author or Editor: |
Pablo Alonso | Sep 22, 2022 | May 05, 2023 | |
Page Chapter 7, Section: Call Signatures Last code snippet and paragraph |
In the code snippet Note from the Author or Editor: |
Sara Regan | May 05, 2023 | Apr 19, 2024 | |
Page Chapter 8. Classes, Section: Function Properties last paragraph/code example |
Text says Note from the Author or Editor: |
Sara | May 12, 2023 | Apr 19, 2024 | |
Page Function Properties Section of Chapter 8 on pg.105 Last line of code |
new WithMethod().myProperty === new WithMethod().myProperty; // false should use WithProperty() not WithMethod() Note from the Author or Editor: |
Jeff | Aug 12, 2023 | Apr 19, 2024 | |
Page Overridden Methods section of Chapter 8 on pg. 117 1st sentence |
Remove "method" after "subclass" in the excerpt below: Note from the Author or Editor: |
Jeff | Aug 13, 2023 | Apr 19, 2024 | |
Page page 5 Code Listing |
'@param {Painting} painter' should be '@param {Painter} painter' Note from the Author or Editor: |
Valentin Jochinger | Dec 23, 2023 | Apr 19, 2024 | |
4 Optional Properties |
In the Optional properties section [author?: string;] is optional, there is no error for [missing], in the graphic it shows the false error "// Error: Property 'author' is missing in type" for [missing] |
Mark Oliver | May 28, 2022 | Jun 03, 2022 | |
Page 6 The praise quote for Lenz |
The name is "Lenz Weber-Tronic" (with a 'c'), not "...Tronik" (with a 'k') Note from the Author or Editor: |
Josh Goldberg | Jun 07, 2022 | Jul 01, 2022 | |
Page 8. Classes Overridden Constructors |
constructor(grade: number) { Note from the Author or Editor: |
Megan Ku | Oct 16, 2022 | May 05, 2023 | |
Page 30 Last paragraph |
"When a value is known to be a union type, TypeScript will only allow you to access Note from the Author or Editor: |
Jens Olaf Koch | Dec 29, 2022 | May 05, 2023 | |
Page 31 2nd paragraph |
Issue with first sentence. Note from the Author or Editor: |
Emrah Abdurahman | Oct 23, 2022 | May 05, 2023 | |
Page 33 Last paragraph |
Change "I'd like go the opposite direction" to "I'd like to go the opposite direction". Note from the Author or Editor: |
Emrah Abdurahman | Oct 23, 2022 | May 05, 2023 | |
Page 36 4. paragraph |
"If you’ve previously worked in a typed language such as C++ or Java that suffers Note from the Author or Editor: |
Jens Olaf Koch | Dec 30, 2022 | May 05, 2023 | |
Page 39 2nd paragraph |
Change "Each of these variables can be one of four possible types" to "Each of these variables can be one of five possible types". Note from the Author or Editor: |
Emrah Abdurahman | Oct 24, 2022 | May 05, 2023 | |
Page 44 End of the code snippet |
`'{ name: string; start: number; }'` should be `'{ born: number; name: string; }` |
Josh Goldberg | Jun 05, 2022 | Jul 01, 2022 | |
Page 45 1st code example |
Change "// Error: Type 'string' is not assignable to 'Poet'" to "// Error: Type 'string' is not assignable to type 'Poet'" in order to include the word "type" and be technically accurate. Note from the Author or Editor: |
Emrah Abdurahman | Oct 25, 2022 | May 05, 2023 | |
Page 46 2nd paragraph |
Change "Structural typing not the same as duck typing,..." to "Structural typing is not the same as duck typing,..." Note from the Author or Editor: |
Emrah Abdurahman | Oct 25, 2022 | May 05, 2023 | |
Page 47 1st sentence of 1st paragraph for section titled "Excess Property Checking" |
Change the first word from "Typescript" to "TypeScript" with an uppercase S. Note from the Author or Editor: |
Emrah Abdurahman | Oct 25, 2022 | May 05, 2023 | |
Page 52 2nd Paragraph In "Explicit Object-Type Unions" |
The sentence: Note from the Author or Editor: |
Sean Lynch | Jul 03, 2022 | Aug 26, 2022 | |
Page 52 Very top of page in code - TypeScript comment |
The text: Note from the Author or Editor: |
Sean Lynch | Jul 03, 2022 | Aug 26, 2022 | |
Page 53 Error message for second code example |
The error message shown in VS Code is: Note from the Author or Editor: |
Emrah Abdurahman | Oct 29, 2022 | May 05, 2023 | |
Page 71 1st code example |
Change "console.log(`${songs}`);" to "console.log(`${song}`);" so it matches the non-plural form of the parameter name. Note from the Author or Editor: |
Emrah Abdurahman | Nov 03, 2022 | May 05, 2023 | |
Page 73 second last paragraph |
"Thus, the return type and each parameter in a function's overload signatures must be assignable to the parameter at the same index in its implementation signature." Note from the Author or Editor: |
Jens Olaf Koch | Jan 11, 2023 | May 05, 2023 | |
Page 76 Crow callout |
Generics are covered in Chapter 10, "Generics", not Chapter 9, "Type Modifiers". |
Josh Goldberg | Jun 05, 2022 | Jul 01, 2022 | |
Page 79 Crow callout |
TypeScript's configuration options are covered in Chapter 13, "Configuration Options", not Chapter 12, "Using IDE Features". |
Josh Goldberg | Jun 05, 2022 | Jul 01, 2022 | |
Page 82 last sentence |
... attempting to pass the entire `[string, [number, boolean]` as the first parameter ... Note from the Author or Editor: |
Jens Olaf Koch | Jan 13, 2023 | May 05, 2023 | |
Page 83 1st code example |
The issue is with the console.log statement inside the logTrio function. It has an opening parenthesis before the third dollar symbol but there is no closing parenthesis. I'm not sure if this is intended or a mistake. Note from the Author or Editor: |
Emrah Abdurahman | Nov 06, 2022 | May 05, 2023 | |
Page 89 Optional Properties code example |
In the provided code example, "author" is an optional property, so it is not "missing" as suggested in the "// Error Property 'author' is missing in type..." Note from the Author or Editor: |
vojimir golem | Sep 11, 2022 | May 05, 2023 | |
Page 90 4th paragraph and accompanying code example |
The paragraph beginning "In this continuation of the exclaim example,..." and the code example below it don't make sense: Note from the Author or Editor: |
Emrah Abdurahman | Nov 07, 2022 | May 05, 2023 | |
Page 90 2nd listing |
const pageIsh = { Note from the Author or Editor: |
Jens Olaf Koch | Jan 17, 2023 | May 05, 2023 | |
Page 101 Squirrel tip |
The URL should be https://learningtypescript.com/interfaces, not https://learningtypescript.com/objects-and-interfaces. Both work but the latter is a redirect to the former. |
Josh Goldberg | Jun 05, 2022 | Jul 01, 2022 | |
Page 103 4th paragraph |
The paragraph refers to Greeter class with greet class method that takes a type number parameter. In the code below we the paragraph, the greet method declares a parameter name of type string. Note from the Author or Editor: |
Anonymous | Aug 18, 2022 | Aug 26, 2022 | |
Page 105 WithProperty class |
I test new WithMethod().myProperty === new WithMethod().myProperty; Note from the Author or Editor: |
hanasiyou | Mar 11, 2023 | May 05, 2023 | |
Page 108 2nd paragraph |
Change "This OptionalProperty class..." to "This MissingInitializer class...". Note from the Author or Editor: |
Emrah Abdurahman | Nov 11, 2022 | May 05, 2023 | |
Page 108 - Chapter 8: Classes Second code example |
The assignment in the Quote constructor has a syntax error. Instead of `this.text = ;`, it should be `this.text = text;`. Note from the Author or Editor: |
Pablo Alonso | Sep 28, 2022 | May 05, 2023 | |
Page 108-9 class Quote |
on p.109 first line, Quote.text = "Ha!" // maybe quote.text = "Ha!" ? Note from the Author or Editor: |
hanasiyou | Mar 28, 2023 | May 05, 2023 | |
Page 116 1st code example |
The following code doesn't make logical sense: Note from the Author or Editor: |
Emrah Abdurahman | Nov 12, 2022 | May 05, 2023 | |
Page 118 Code example at the top of page 118 |
There seems to be an issue with the following code example: Note from the Author or Editor: |
Emrah Abdurahman | Nov 12, 2022 | May 05, 2023 | |
Page 119 Error message comments at the top of page 119 |
It should say "Error: Property 'value' in type 'VagueGrade' is not assignable to the same property in base type 'NumericGrade'." Note from the Author or Editor: |
Emrah Abdurahman | Nov 13, 2022 | May 05, 2023 | |
Page 122 2nd paragraph of section titled "Static Field Modifiers" |
Change "This HasStatic class..." to "This Question class..." in order to match the class name below it. Note from the Author or Editor: |
Emrah Abdurahman | Nov 13, 2022 | May 05, 2023 | |
Page 123 Code comment at top of page 123 |
Change "HasStatic" to be "Question" in the error code example. Note from the Author or Editor: |
Emrah Abdurahman | Nov 13, 2022 | May 05, 2023 | |
Page 126 Code snippet at the bottom of page 126 |
For the first if branch inside of the greetComedianSafety() function, change it from "if (typeof value === "string")" to "if (typeof name === "string")" so it matches the parameter. Note from the Author or Editor: |
Emrah Abdurahman | Nov 14, 2022 | May 05, 2023 | |
Page 130 1st code example at the top of page 130 |
Change "const ratings: Ratings = { audience: 66, critic: 84 };" to "const ratings: Ratings = { audience: 66, critics: 84 };". Note from the Author or Editor: |
Emrah Abdurahman | Nov 16, 2022 | May 05, 2023 | |
Page 130 All code examples on page 130 |
Change all object declarations to have the plural form of the property critic. Note from the Author or Editor: |
Emrah Abdurahman | Nov 16, 2022 | May 05, 2023 | |
Page 132 1st code example's error message at the top of page 132 |
Change "// Error: Argument of type '"missing"'..." to "// Error: Argument of type '"invalid"'...". Note from the Author or Editor: |
Emrah Abdurahman | Nov 16, 2022 | May 05, 2023 | |
Page 134 1st sentence of 1st paragraph for section titled "Non-Null Assertions" |
In the first sentence, "defined" should be "undefined". Note from the Author or Editor: |
Emrah Abdurahman | Nov 17, 2022 | May 05, 2023 | |
Page 135 1st code example |
The "maybeValue" and "knownValue" variables will be of type "number | undefined" and "number" respectively as Map.get() is retrieving the numeric value of the provided string key. Note from the Author or Editor: |
Emrah Abdurahman | Nov 17, 2022 | May 05, 2023 | |
Page 135 Code example at the bottom of page 135 for the section titled "Type Assertion Caveats" |
The "knownValue" variable will be of type "number" rather than "string" as the Map.get() method is returning the corresponding number value for the provided string key. Note from the Author or Editor: |
Emrah Abdurahman | Nov 17, 2022 | May 05, 2023 | |
Page 136 1st code example |
The first error comment states { one: number; } which needs to be changed to { name: string; }. Note from the Author or Editor: |
Emrah Abdurahman | Nov 17, 2022 | May 05, 2023 | |
Page 137 First sentence under |
The `as const` syntax was introduced in Chapter 6, "Arrays", not Chapter 4, "Objects". |
Joshua Goldberg |
Jun 05, 2022 | Jul 01, 2022 | |
Page 138 Error message comments at the bottom of page 138 |
"LogAction" should be "Joke" instead. Note from the Author or Editor: |
Emrah Abdurahman | Nov 18, 2022 | May 05, 2023 | |
Page 139 Second sentence of third paragraph |
The variable "favoritesConst" is not defined in the code example on page 139. Did you mean "preferencesReadonly" instead? Note from the Author or Editor: |
Emrah Abdurahman | Nov 18, 2022 | May 05, 2023 | |
Page 142 1st code example |
Change the following code: Note from the Author or Editor: |
Emrah Abdurahman | Nov 18, 2022 | May 05, 2023 | |
Page 147 Second code example just before the start of the "Generic Classes" section |
The usage and error message of the CrateLike<T> interface are incorrectly named. Note from the Author or Editor: |
Emrah Abdurahman | Nov 20, 2022 | May 05, 2023 | |
Page 154 Bottom code snippet |
The type of allExplicit is KeyValuePair<string, number>, not KeyValuePair<string, string>. |
Josh Goldberg | Jun 05, 2022 | Jul 01, 2022 | |
Page 154 middle |
Should we delete // and move tilde symbol under the word “value? Note from the Author or Editor: |
Sophia | Apr 05, 2023 | May 05, 2023 | |
Page 155 Code example at the top of page 155 |
The type inferred by TypeScript for the variable "oneDefaulting" is "KeyValuePair<string, string>" rather than "KeyValuePair<string>". Note from the Author or Editor: |
Emrah Abdurahman | Nov 23, 2022 | May 05, 2023 | |
Page 158 3rd paragraph |
The third paragraph states that lengthEventually waits an additional second to resolve with a number. Note from the Author or Editor: |
Emrah Abdurahman | Nov 24, 2022 | May 05, 2023 | |
Page 173 Last sentence of last paragraph at the bottom of page 173 |
For the last sentence at the bottom of page 173 which says "For example, the Storage interface...", add the word "is" between "interface" and "used" so it says "interface is used" rather than "interface used". Note from the Author or Editor: |
Emrah Abdurahman | Nov 27, 2022 | May 05, 2023 | |
Page 176 1st sentence of 1st paragraph |
Remove the word "some" from the first sentence "...they might look some something like these files.". Note from the Author or Editor: |
Emrah Abdurahman | Nov 27, 2022 | May 05, 2023 | |
Page 216 Second sentence of first paragraph of section titled "strictFunctionTypes" |
This sentence states the following: "A function type is no longer considered assignable to another function type if its parameters are subtypes of that other type's parameters.". Note from the Author or Editor: |
Emrah Abdurahman | Dec 04, 2022 | May 05, 2023 | |
Page 228 Code snippet at the bottom of page 228 |
The "composite" setting should be nested inside the "compilerOptions". Note from the Author or Editor: |
Emrah Abdurahman | Dec 13, 2022 | May 05, 2023 | |
Page 238 First sentence of last paragraph |
The key of the property should be "greet" instead of "log". Note from the Author or Editor: |
Emrah Abdurahman | Dec 15, 2022 | May 05, 2023 | |
Page 246 Code example at the bottom of page 246 |
I'm not too sure if this is correct. Note from the Author or Editor: |
Emrah Abdurahman | Dec 16, 2022 | May 05, 2023 | |
Page 248 Code example at the bottom of page 248 |
The describe() function is using "Settings.name" and "Settings.version" in its template string literal. Note from the Author or Editor: |
Emrah Abdurahman | Dec 16, 2022 | May 05, 2023 | |
Page 256 Second paragraph of section titled "Changing Modifiers" on page 256 |
"OptionalReadonlyConservationist" should be "OptionalReadonlyEnvironmentalist" to match the type name in the code below. Note from the Author or Editor: |
Emrah Abdurahman | Dec 18, 2022 | May 05, 2023 | |
Page 261 https://www.google.ca/books/edition/Learning_TypeScript/YD5zEAAAQBAJ?hl=en&gbpv=1&dq=throwIfNotFound+Conditional+types+distribute+over+unions&pg=PA261&printsec=frontcover |
ConditionalType<T | U> is the same as Conditional<T> | Conditional<U> Note from the Author or Editor: |
Ting Chong Ma | Nov 02, 2022 | May 05, 2023 | |
Page 264 2nd paragraph of section titled "never and Conditional Types" |
Change the word "null" to "false" in the sentence ""This OnlyStrings generic conditional type filters out types..." so it matches the union provided to OnlyStrings<> in the code below this sentence. Note from the Author or Editor: |
Emrah Abdurahman | Dec 24, 2022 | May 05, 2023 | |
Page 269 second paragraph and first full code comment |
Change "This ConfigGetter type is based..." to "This LazyValues type is based...". Note from the Author or Editor: |
Emrah Abdurahman | Dec 25, 2022 | May 05, 2023 | |
Page 274 Last sentence of glossary term "distributivity" |
Change the last sentence of the "distributivity" glossary entry to "ConditionalType<T | U> is the same as ConditionalType<T> | ConditionalType<U>". Note from the Author or Editor: |
Emrah Abdurahman | Dec 25, 2022 | May 05, 2023 | |
Page 277 Second sentence of glossary entry "target" |
Add the word "to" in between the words "advisable" and "use" so it says "...it's advisable to use as new JavaScript syntax...". Note from the Author or Editor: |
Emrah Abdurahman | Dec 26, 2022 | May 05, 2023 |