Errata

Effective TypeScript

Errata for Effective TypeScript

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Printed Page Item 7: Think of Types as Sets of Values (page 32)
Most of it

To clarify future editions—and especially, to reinforce the message of Item 14 (Use Type Operations and Generics to Avoid Repeating Yourself)—it would help to replace the Vector1, Vector2, Vector3 example from Item 7 with something else. The book presents type-operational equivalents two pages later in `[number, number]` and `[number, number, number]`; since `x`, `y` and `z` are basically ordered placeholders just like '0', '1', and '2', intuition suggests a similar relationship between the VectorN types and list types (and indeed, some programming languages use the two terms interchangeably). Even sticking to the geometric usage of "Vector", one doesn't typically say a 3d vector "is-a" 2d vector, but that one can project the former to the latter. While it's all still correct by the rules of TS, an example with less conceptual baggage would reduce the opportunity for confusion.

And thank you for your work creating Effective TypeScript. I would not mention the above issue, were it not for the overall superb quality of the book—evidence you all care a great deal that the writing be clear as possible.

William Cybriwsky  Apr 14, 2024 
Printed Page Item 15: Use Index Signatures for Dynamic Data (page 66)
3rd code block

line 2:
`const prices: {[produt: string]: number} = {};`

s/produt/product/g

William Cybriwsky  Apr 14, 2024