Table of Contents for
Understanding ECMAScript 6

Version ebook / Retour

Cover image for bash Cookbook, 2nd Edition Understanding ECMAScript 6 by Nicholas C. Zakas Published by No Starch Press, 2016
  1. Understanding ECMAScript 6
  2. Understanding ECMAScript 6
  3. Understanding ECMAScript 6
  4. Understanding ECMAScript 6
  5. Understanding ECMAScript 6
  6. Understanding ECMAScript 6
  7. Understanding ECMAScript 6
  8. Understanding ECMAScript 6
  9. Understanding ECMAScript 6
  10. Understanding ECMAScript 6
  11. Understanding ECMAScript 6
  12. Understanding ECMAScript 6
  13. Understanding ECMAScript 6
  14. Understanding ECMAScript 6
  15. Understanding ECMAScript 6
  16. Understanding ECMAScript 6
  17. Understanding ECMAScript 6
  18. Understanding ECMAScript 6
  19. Understanding ECMAScript 6
  20. Understanding ECMAScript 6
  21. Understanding ECMAScript 6
  22. Understanding ECMAScript 6
  23. Understanding ECMAScript 6
  24. Understanding ECMAScript 6
  25. Understanding ECMAScript 6
  26. Understanding ECMAScript 6
  27. Understanding ECMAScript 6
  28. Understanding ECMAScript 6
  29. Understanding ECMAScript 6

Contents in Detail

  1. Cover Page
  2. Title Page
  3. Copyright Page
  4. Brief Contents
  5. Contents in Detail
  6. Foreword
  7. Acknowledgments
  8. Introduction
    1. The Road to ECMAScript 6
    2. About This Book
      1. Browser and Node.js Compatibility
      2. Who This Book Is For
      3. Overview
      4. Conventions Used
      5. Help and Support
  9. Chapter 1: Block Bindings
    1. var Declarations and Hoisting
    2. Block-Level Declarations
      1. let Declarations
      2. No Redeclaration
      3. const Declarations
      4. The Temporal Dead Zone
    3. Block Bindings in Loops
      1. Functions in Loops
      2. let Declarations in Loops
      3. const Declarations in Loops
    4. Global Block Bindings
    5. Emerging Best Practices for Block Bindings
    6. Summary
  10. Chapter 2: Strings and Regular Expressions
    1. Better Unicode Support
      1. UTF-16 Code Points
      2. The codePointAt() Method
      3. The String.fromCodePoint() Method
      4. The normalize() Method
      5. The Regular Expression u Flag
    2. Other String Changes
      1. Methods for Identifying Substrings
      2. The repeat() Method
    3. Other Regular Expression Changes
      1. The Regular Expression y Flag
      2. Duplicating Regular Expressions
      3. The flags Property
    4. Template Literals
      1. Basic Syntax
      2. Multiline Strings
      3. Making Substitutions
      4. Tagged Templates
    5. Summary
  11. Chapter 3: Functions
    1. Functions with Default Parameter Values
      1. Simulating Default Parameter Values in ECMAScript 5
      2. Default Parameter Values in ECMAScript 6
      3. How Default Parameter Values Affect the arguments Object
      4. Default Parameter Expressions
      5. Default Parameter TDZ
    2. Working with Unnamed Parameters
      1. Unnamed Parameters in ECMAScript 5
      2. Rest Parameters
    3. Increased Capabilities of the Function Constructor
    4. The Spread Operator
    5. The name Property
      1. Choosing Appropriate Names
      2. Special Cases of the name Property
    6. Clarifying the Dual Purpose of Functions
      1. Determining How a Function Was Called in ECMAScript 5
      2. The new.target Metaproperty
    7. Block-Level Functions
      1. Deciding When to Use Block-Level Functions
      2. Block-Level Functions in Non-Strict Mode
    8. Arrow Functions
      1. Arrow Function Syntax
      2. Creating Immediately Invoked Function Expressions
      3. No this Binding
      4. Arrow Functions and Arrays
      5. No arguments Binding
      6. Identifying Arrow Functions
    9. Tail Call Optimization
      1. How Tail Calls Are Different in ECMAScript 6
      2. How to Harness Tail Call Optimization
    10. Summary
  12. Chapter 4: Expanded Object Functionality
    1. Object Categories
    2. Object Literal Syntax Extensions
      1. Property Initializer Shorthand
      2. Concise Methods
      3. Computed Property Names
    3. New Methods
      1. The Object.is() Method
      2. The Object.assign() Method
    4. Duplicate Object Literal Properties
    5. Own Property Enumeration Order
    6. Enhancements for Prototypes
      1. Changing an Object’s Prototype
      2. Easy Prototype Access with Super References
    7. A Formal Method Definition
    8. Summary
  13. Chapter 5: Destructuring for Easier Data Access
    1. Why Is Destructuring Useful?
    2. Object Destructuring
      1. Destructuring Assignment
      2. Default Values
      3. Assigning to Different Local Variable Names
      4. Nested Object Destructuring
    3. Array Destructuring
      1. Destructuring Assignment
      2. Default Values
      3. Nested Array Destructuring
      4. Rest Items
    4. Mixed Destructuring
    5. Destructured Parameters
      1. Destructured Parameters Are Required
      2. Default Values for Destructured Parameters
    6. Summary
  14. Chapter 6: Symbols and Symbol Properties
    1. Creating Symbols
    2. Using Symbols
    3. Sharing Symbols
    4. Symbol Coercion
    5. Retrieving Symbol Properties
    6. Exposing Internal Operations with Well-Known Symbols
      1. The Symbol.hasInstance Method
      2. The Symbol.isConcatSpreadable Property
      3. The Symbol.match, Symbol.replace, Symbol.search, and Symbol.split Properties
      4. The Symbol.toPrimitive Method
      5. The Symbol.toStringTag Property
      6. The Symbol.unscopables Property
    7. Summary
  15. Chapter 7: Sets and Maps
    1. Sets and Maps in ECMAScript 5
    2. Problems with Workarounds
    3. Sets in ECMAScript 6
      1. Creating Sets and Adding Items
      2. Removing Items
      3. The forEach() Method for Sets
      4. Converting a Set to an Array
      5. Weak Sets
    4. Maps in ECMAScript 6
      1. Map Methods
      2. Map Initialization
      3. The forEach() Method for Maps
      4. Weak Maps
    5. Summary
  16. Chapter 8: Iterators and Generators
    1. The Loop Problem
    2. What Are Iterators?
    3. What Are Generators?
      1. Generator Function Expressions
      2. Generator Object Methods
    4. Iterables and for-of Loops
      1. Accessing the Default Iterator
      2. Creating Iterables
    5. Built-In Iterators
      1. Collection Iterators
      2. String Iterators
      3. NodeList Iterators
    6. The Spread Operator and Nonarray Iterables
    7. Advanced Iterator Functionality
      1. Passing Arguments to Iterators
      2. Throwing Errors in Iterators
      3. Generator Return Statements
      4. Delegating Generators
    8. Asynchronous Task Running
      1. A Simple Task Runner
      2. Task Running with Data
      3. An Asynchronous Task Runner
    9. Summary
  17. Chapter 9: Introducing JavaScript Classes
    1. Class-Like Structures in ECMAScript 5
    2. Class Declarations
      1. A Basic Class Declaration
      2. Why Use the Class Syntax?
    3. Class Expressions
      1. A Basic Class Expression
      2. Named Class Expressions
    4. Classes as First-Class Citizens
    5. Accessor Properties
    6. Computed Member Names
    7. Generator Methods
    8. Static Members
    9. Inheritance with Derived Classes
      1. Shadowing Class Methods
      2. Inherited Static Members
      3. Derived Classes from Expressions
      4. Inheriting from Built-Ins
      5. The Symbol.species Property
    10. Using new.target in Class Constructors
    11. Summary
  18. Chapter 10: Improved Array Capabilities
    1. Creating Arrays
      1. The Array.of() Method
      2. The Array.from() Method
    2. New Methods on All Arrays
      1. The find() and findIndex() Methods
      2. The fill() Method
      3. The copyWithin() Method
    3. Typed Arrays
      1. Numeric Data Types
      2. Array Buffers
      3. Manipulating Array Buffers with Views
    4. Similarities Between Typed and Regular Arrays
      1. Common Methods
      2. The Same Iterators
      3. The of() and from() Methods
    5. Differences Between Typed and Regular Arrays
      1. Behavioral Differences
      2. Missing Methods
      3. Additional Methods
    6. Summary
  19. Chapter 11: Promises and Asynchronous Programming
    1. Asynchronous Programming Background
      1. The Event Model
      2. The Callback Pattern
    2. Promise Basics
      1. The Promise Life Cycle
      2. Creating Unsettled Promises
      3. Creating Settled Promises
      4. Executor Errors
    3. Global Promise Rejection Handling
      1. Node.js Rejection Handling
      2. Browser Rejection Handling
    4. Chaining Promises
      1. Catching Errors
      2. Returning Values in Promise Chains
      3. Returning Promises in Promise Chains
    5. Responding to Multiple Promises
      1. The Promise.all() Method
      2. The Promise.race() Method
    6. Inheriting from Promises
    7. Promise-Based Asynchronous Task Running
    8. Summary
  20. Chapter 12: Proxies and the Reflection API
    1. The Array Problem
    2. Introducing Proxies and Reflection
    3. Creating a Simple Proxy
    4. Validating Properties Using the set Trap
    5. Object Shape Validation Using the get Trap
    6. Hiding Property Existence Using the has Trap
    7. Preventing Property Deletion with the deleteProperty Trap
    8. Prototype Proxy Traps
      1. How Prototype Proxy Traps Work
      2. Why Two Sets of Methods?
    9. Object Extensibility Traps
      1. Two Basic Examples
      2. Duplicate Extensibility Methods
    10. Property Descriptor Traps
      1. Blocking Object.defineProperty()
      2. Descriptor Object Restrictions
      3. Duplicate Descriptor Methods
    11. The ownKeys Trap
    12. Function Proxies with the apply and construct Traps
      1. Validating Function Parameters
      2. Calling Constructors Without new
      3. Overriding Abstract Base Class Constructors
      4. Callable Class Constructors
    13. Revocable Proxies
    14. Solving the Array Problem
      1. Detecting Array Indexes
      2. Increasing length When Adding New Elements
      3. Deleting Elements When Reducing length
      4. Implementing the MyArray Class
    15. Using a Proxy as a Prototype
      1. Using the get Trap on a Prototype
      2. Using the set Trap on a Prototype
      3. Using the has Trap on a Prototype
      4. Proxies as Prototypes on Classes
    16. Summary
  21. Chapter 13: Encapsulating Code with Modules
    1. What Are Modules?
    2. Basic Exporting
    3. Basic Importing
      1. Importing a Single Binding
      2. Importing Multiple Bindings
      3. Importing an Entire Module
      4. A Subtle Quirk of Imported Bindings
    4. Renaming Exports and Imports
    5. Default Values in Modules
      1. Exporting Default Values
      2. Importing Default Values
    6. Re-exporting a Binding
    7. Importing Without Bindings
    8. Loading Modules
      1. Using Modules in Web Browsers
      2. Browser Module Specifier Resolution
    9. Summary
  22. Appendix A: Minor Changes in ECMAScript 6
    1. Working with Integers
      1. Identifying Integers
      2. Safe Integers
    2. New Math Methods
    3. Unicode Identifiers
    4. Formalizing the __proto__ Property
  23. Appendix B: Understanding ECMAScript 7 (2016)
    1. The Exponentiation Operator
      1. Order of Operations
      2. Operand Restriction
    2. The Array.prototype.includes() Method
      1. How to Use Array.prototype.includes()
      2. Value Comparison
    3. A Change to Function-Scoped Strict Mode
  24. Index
  25. Updates
  26. Level Up Your JavaScript
  1. i
  2. ii
  3. iii
  4. iv
  5. v
  6. vi
  7. vii
  8. viii
  9. ix
  10. x
  11. xi
  12. xii
  13. xiii
  14. xiv
  15. xv
  16. xvi
  17. xvii
  18. xviii
  19. xix
  20. xx
  21. xxi
  22. xxii
  23. xxiii
  24. xxiv
  25. xxv
  26. xxvi
  27. 1
  28. 2
  29. 3
  30. 4
  31. 5
  32. 6
  33. 7
  34. 8
  35. 9
  36. 10
  37. 11
  38. 12
  39. 13
  40. 14
  41. 15
  42. 16
  43. 17
  44. 18
  45. 19
  46. 20
  47. 21
  48. 22
  49. 23
  50. 24
  51. 25
  52. 26
  53. 27
  54. 28
  55. 29
  56. 30
  57. 31
  58. 32
  59. 33
  60. 34
  61. 35
  62. 36
  63. 37
  64. 38
  65. 39
  66. 40
  67. 41
  68. 42
  69. 43
  70. 44
  71. 45
  72. 46
  73. 47
  74. 48
  75. 49
  76. 50
  77. 51
  78. 52
  79. 53
  80. 54
  81. 55
  82. 56
  83. 57
  84. 58
  85. 59
  86. 60
  87. 61
  88. 62
  89. 63
  90. 64
  91. 65
  92. 66
  93. 67
  94. 68
  95. 69
  96. 70
  97. 71
  98. 72
  99. 73
  100. 74
  101. 75
  102. 76
  103. 77
  104. 78
  105. 79
  106. 80
  107. 81
  108. 82
  109. 83
  110. 84
  111. 85
  112. 86
  113. 87
  114. 88
  115. 89
  116. 90
  117. 91
  118. 92
  119. 93
  120. 94
  121. 95
  122. 96
  123. 97
  124. 98
  125. 99
  126. 100
  127. 101
  128. 102
  129. 103
  130. 104
  131. 105
  132. 106
  133. 107
  134. 108
  135. 109
  136. 110
  137. 111
  138. 112
  139. 113
  140. 114
  141. 115
  142. 116
  143. 117
  144. 118
  145. 119
  146. 120
  147. 121
  148. 122
  149. 123
  150. 124
  151. 125
  152. 126
  153. 127
  154. 128
  155. 129
  156. 130
  157. 131
  158. 132
  159. 133
  160. 134
  161. 135
  162. 136
  163. 137
  164. 138
  165. 139
  166. 140
  167. 141
  168. 142
  169. 143
  170. 144
  171. 145
  172. 146
  173. 147
  174. 148
  175. 149
  176. 150
  177. 151
  178. 152
  179. 153
  180. 154
  181. 155
  182. 156
  183. 157
  184. 158
  185. 159
  186. 160
  187. 161
  188. 162
  189. 163
  190. 164
  191. 165
  192. 166
  193. 167
  194. 168
  195. 169
  196. 170
  197. 171
  198. 172
  199. 173
  200. 174
  201. 175
  202. 176
  203. 177
  204. 178
  205. 179
  206. 180
  207. 181
  208. 182
  209. 183
  210. 184
  211. 185
  212. 186
  213. 187
  214. 188
  215. 189
  216. 190
  217. 191
  218. 192
  219. 193
  220. 194
  221. 195
  222. 196
  223. 197
  224. 198
  225. 199
  226. 200
  227. 201
  228. 202
  229. 203
  230. 204
  231. 205
  232. 206
  233. 207
  234. 208
  235. 209
  236. 210
  237. 211
  238. 212
  239. 213
  240. 214
  241. 215
  242. 216
  243. 217
  244. 218
  245. 219
  246. 220
  247. 221
  248. 222
  249. 223
  250. 224
  251. 225
  252. 226
  253. 227
  254. 228
  255. 229
  256. 230
  257. 231
  258. 232
  259. 233
  260. 234
  261. 235
  262. 236
  263. 237
  264. 238
  265. 239
  266. 240
  267. 241
  268. 242
  269. 243
  270. 244
  271. 245
  272. 246
  273. 247
  274. 248
  275. 249
  276. 250
  277. 251
  278. 252
  279. 253
  280. 254
  281. 255
  282. 256
  283. 257
  284. 258
  285. 259
  286. 260
  287. 261
  288. 262
  289. 263
  290. 264
  291. 265
  292. 266
  293. 267
  294. 268
  295. 269
  296. 270
  297. 271
  298. 272
  299. 273
  300. 274
  301. 275
  302. 276
  303. 277
  304. 278
  305. 279
  306. 280
  307. 281
  308. 282
  309. 283
  310. 284
  311. 285
  312. 286
  313. 287
  314. 288
  315. 289
  316. 290
  317. 291
  318. 292
  319. 293
  320. 294
  321. 295
  322. 296
  323. 297
  324. 298
  325. 299
  326. 300
  327. 301
  328. 302
  329. 303
  330. 304
  331. 305
  332. 306
  333. 307
  334. 308
  335. 309
  336. 310
  337. 311
  338. 312
  339. 313
  340. 314
  341. 315
  342. 316
  343. 317
  344. 318
  345. 319
  346. 320
  347. 321
  348. 322
  349. 323
  350. 324
  351. 325
  352. 326
  353. 327
Back to top