TypeScript入門與區塊鏈專案實戰(TypeScript Quickly)錯誤記錄
- 版本版次
- 錯誤記錄
- 翻譯
- 鏈接
首先感謝幾位譯者的辛苦付出,為了幫助后面閱讀這本書的更多人,將自己在閱讀程序中遇到的一些錯誤及讀起來不太通順或是費解的地方對比原版做出如下記錄, 一家之言,僅供參考,
版本版次
《TypeScript入門與區塊鏈專案實戰》
版次:2021年5月第1版
印次:2021年5月第1次印刷
《TypeScript Quickly》
錯誤記錄
p31:在發出的Java代碼中都不會有表示
修改:在發出的JavaScript代碼中都不會有表示
原文:Neither interfaces nor types declared with the type keyword have representations in the emitted JavaScript code, which makes the runtime code smaller (bytewise).
p33:應用正方形公式
修改:應用矩形公式
原文:Applies the formula for rectangles
p34 要解決這個問題,需要運行上述代碼
修改:要體驗這個問題,(可意譯為“可運行這部分代碼親自體驗”)
原文:To experience this issue, you need to run this code.
p34 只是isPerson()保護獲得一個錯誤物件作為引數
修改:除非isPerson()保護獲得一個錯誤物件作為引數
原文:This code has no compilation errors, and it works as expected unless the isPerson() guard gets a falsy object as an argument.
p61:列舉——一種基于有限的值集合型別創建新型別的方式,
修改:列舉——一種基于有限的值集合型別 創建新型別的方式,(刪掉第一個“型別”)
原文:In this chapter, you’ll learn how to use enums—a way to create a new type based on a limited set of values.
p71:當泛型型別由函式引數指定時,不需要尖括號——在代碼清單4.9中可以看到該型別語法,
修改:當泛型型別由函式引數指定時,不需要尖括號——在代碼清單4.10中可以看到該型別語法,
備注:代碼清單4.9 未采用泛型型別的介面、代碼清單4.10 使用帶泛型型別的介面
interface Comparator <T> {
compareTo(value: T): number;
}
p71:字母T表示型別,這很直觀,但是任何字母或單詞都可用于宣告泛型型別,在圖中,開發者通常使用字母K表示鍵,V表示值,
修改:字母T表示型別,這很直觀,但是任何字母或單詞都可用于宣告泛型型別,在map集合中,開發者通常使用字母K表示鍵,V表示值,
原文:The letter T stands for type, which is intuitive, but any letter or word can be used when declaring a generic type. In a map, developers often use the letters K for key and V for value.
p132:為部署Web應用,我們通常系結源檔案以減少瀏覽器需要下載的檔案數量,
修改:為部署Web應用,我們通常打包源檔案以減少瀏覽器需要下載的檔案數量,
原文:To deploy a web app, we usually bundle up the source files to decrease the number of files the browser needs to download. Webpack is one of the most popular bundlers.
p:
修改:
原文:
翻譯
p39:在后臺,JavaScript支持原型面向物件繼承
參考:Under the hood 怎么翻譯才地道?
原文:Under the hood, JavaScript supports prototypal object-based inheritance, where one object can be assigned to another object as its prototypethis happens at runtime.
p67:聽起來很奇怪,型別能夠被引數化——你可以提供作為一種引數的型別(沒有值),
參考:聽起來或許有點奇怪,型別可以被引數化——你可以將型別(而不是值)作為引數來使用,
原文:Strange as it may sound, types can be parameterized—you can provide a type (not the value) as a parameter.
p71:保護開發者安全的網,
參考:保護開發者的安全網,
原文:Using type parameters is just a safety net for developers at compile time.
p81:TypeScript的enum關鍵字可用于定義常量的有限集合,
參考:TypeScript的enum關鍵字可用于定義一組有限常量集合,
原文:TypeScript has an enum keyword that can define a limited set of constants.
p83:你很想知道還有什么是有用的,在處理介面時,泛型及列舉尚不夠充分,
參考:你很想知道假設通過介面、泛型以及列舉這些方法不足以應對的時候還有哪些額外的手段,
原文:You’re curious to learn what else is available, as if dealing with interfaces, generics, and enums is not enough.
p106:看到同樣的自動完成工具和錯誤資訊提示,
參考:看到一致的自動補全及錯誤資訊提示,
原文:You’ll see the same autocomplete and error messages in the online TypeScript Playground, in Visual Studio Code, or in WebStorm.
p:
參考:
原文:
鏈接
[1] 《TypeScript入門與區塊鏈專案實戰》之“使用TypeScript編程的理由”
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/394004.html
標籤:區塊鏈
