Details

JavaScript


JavaScript

The New Toys
1. Aufl.

von: T. J. Crowder

25,99 €

Verlag: Wiley
Format: PDF
Veröffentl.: 25.06.2020
ISBN/EAN: 9781119367970
Sprache: englisch
Anzahl Seiten: 608

DRM-geschütztes eBook, Sie benötigen z.B. Adobe Digital Editions und eine Adobe ID zum Lesen.

Beschreibungen

<p><b>All of JavaScript's newest features, in depth, made easy to understand.</b></p> <p>JavaScript is a rapidly changing language and it can be challenging to keep up with all the new toys being added. <i>JavaScript: The New Toys</i> explores the newest features of the world's most popular programming language while also showing readers how to track what's coming next. After setting the stage by covering who manages the process of improving JavaScript, how new features get introduced, terminology, and a high-level overview of new features, it details each new or updated item in depth, with example uses, possible pitfalls, and expert recommendations for updating old habits in light of new features.  JavaScript: The New Toys:</p> <ul> <li>Covers all the additions to JavaScript in ES2015-ES2020 plus a preview of what's coming next</li> <li>Explores the latest syntax: nullish coalescing, optional chaining, <code>let</code> and <code>const</code>, <code>class</code> syntax, private methods, private fields, <code>new.target</code>, numeric separators, BigInt, destructuring, default parameters, arrow functions, <code>async</code> functions, <code>await</code>, generator functions, <code>...</code> (rest and spread), template literals, binary and octal literals, <code>**</code> (exponentiation), computed property/method names, <code>for-of</code>, <code>for-await-of</code>, shorthand properties, and others</li> <li>Details the new features and patterns including modules, promises, iteration, generators, Symbol, Proxy, reflection, typed arrays, Atomics, shared memory, WeakMap, WeakSet, and more</li> <li>Highlights common pitfalls and explains how to avoid them</li> <li>Shows how to follow the improvements process and even participate in the process yourself</li> <li>Explains how to use new features even before they're widely supported</li> </ul> <p>With its comprehensive coverage and friendly, accessible style, <i>JavaScript: The New Toys</i> provides an invaluable resource for programmers everywhere, whether they work in web development, Node.js, Electron, Windows Universal Apps, or another JavaScript environment.</p>
<p>Introduction xxxi</p> <p><b>Chapter 1: The New Toys In ES2015–ES2020, and Beyond 1</b></p> <p>Definitions, Who’s Who, and Terminology 2</p> <p>What are the “New Toys”? 4</p> <p>How Do New Toys Get Created? 6</p> <p>Keeping Up with the New Toys 9</p> <p>Using Today’s Toys in Yesterday’s Environments, and Tomorrow’s Toys Today 10</p> <p>Review 15</p> <p><b>Chapter 2: Block-Scoped Declarations: Let and Const 17</b></p> <p>An Introduction to let and const 18</p> <p>True Block Scope 18</p> <p>Repeated Declarations are an Error 19</p> <p>Hoisting and the Temporal Dead Zone 20</p> <p>A New Kind of Global 22</p> <p>const: Constants for JavaScript 24</p> <p>Block Scope in Loops 26</p> <p>Old Habits to New 36</p> <p><b>Chapter 3: New Function Features 39</b></p> <p>Arrow Functions and Lexical this, super, etc. 40</p> <p>Default Parameter Values 45</p> <p> “Rest” Parameters 50</p> <p>Trailing Commas in Parameter Lists and Function Calls 52</p> <p>The Function name Property 53</p> <p>Function Declarations in Blocks 55</p> <p>Function Declarations in Blocks: Standard Semantics 57</p> <p>Old Habits to New 60</p> <p><b>Chapter 4: Classes 65</b></p> <p>What is a Class? 66</p> <p>Introducing the New class Syntax 66</p> <p>Comparing with the Older Syntax 75</p> <p>Creating Subclasses 77</p> <p>Leaving Off Object.prototype 97</p> <p>new.target 98</p> <p>class Declarations vs. class Expressions 101</p> <p>More to Come 103</p> <p>Old Habits to New 104</p> <p><b>Chapter 5: New Object Features 105</b></p> <p>Computed Property Names 106</p> <p>Shorthand Properties 107</p> <p>Getting and Setting an Object’s Prototype 107</p> <p>Method Syntax, and super Outside Classes 109</p> <p>Symbol 112</p> <p>New Object Functions 120</p> <p>Symbol.toPrimitive 123</p> <p>Property Order 125</p> <p>Property Spread Syntax 127</p> <p>Old Habits to New 128</p> <p><b>Chapter 6: Iterables, Iterators, For-Of, Iterable Spread, Generators 131</b></p> <p>Iterators, Iterables, the for-of Loop, and Iterable Spread Syntax 131</p> <p>Generator Functions 146</p> <p>Old Habits to New 163</p> <p><b>Chapter 7: Destructuring 165</b></p> <p>Overview 165</p> <p>Basic Object Destructuring 166</p> <p>Basic Array (and Iterable) Destructuring 169</p> <p>Defaults 170</p> <p>Rest Syntax in Destructuring Patterns 172</p> <p>Using Different Names 173</p> <p>Computed Property Names 174</p> <p>Nested Destructuring 174</p> <p>Parameter Destructuring 175</p> <p>Destructuring in Loops 178</p> <p>Old Habits to New 179</p> <p><b>Chapter 8: Promises 181</b></p> <p>Why Promises? 182</p> <p>Promise Fundamentals 182</p> <p>Using an Existing Promise 186</p> <p>Adding Handlers to Already Settled Promises 201</p> <p>Creating Promises 202</p> <p>Other Promise Utility Methods 207</p> <p>Promise Patterns 210</p> <p>Handle Errors or Return the Promise 210</p> <p>Promises in Series 211</p> <p>Promises in Parallel 213</p> <p>Promise Subclasses 218</p> <p>Old Habits to New 219</p> <p><b>Chapter 9: Asynchronous Functions, Iterators, and Generators 221</b></p> <p>async Functions 222</p> <p>async Iterators, Iterables, and Generators 232</p> <p>for-await-of 238</p> <p>Old Habits to New 238</p> <p><b>Chapter 10: Templates, Tag Functions, and New String Features 241</b></p> <p>Template Literals 241</p> <p>Improved Unicode Support 250</p> <p>Iteration 255</p> <p>New String Methods 256</p> <p>Updates to the match, split, search, and replace Methods 259</p> <p>Old Habits to New 260</p> <p><b>Chapter 11: New Array Features, Typed Arrays 263</b></p> <p>New Array Methods 264</p> <p>Iteration, Spread, Destructuring 276</p> <p>Stable Array Sort 276</p> <p>Typed Arrays 277</p> <p>Old Habits to New 292</p> <p><b>Chapter 12: Maps and Sets 293</b></p> <p>Maps 293</p> <p>Sets 300</p> <p>WeakMaps 304</p> <p>WeakSets 314</p> <p>Old Habits to New 316</p> <p><b>Chapter 13: Modules 319</b></p> <p>Introduction to Modules 319</p> <p>Module Fundamentals 320</p> <p>Renaming Exports 331</p> <p>Re-Exporting Exports from Another Module 332</p> <p>Renaming Imports 333</p> <p>Importing a Module’s Namespace Object 333</p> <p>Exporting Another Module’s Namespace Object 334</p> <p>Importing a Module Just for Side Effects 335</p> <p>Import and Export Entries 335</p> <p>Imports are Live and Read-Only 338</p> <p>Module Instances are Realm-Specific 340</p> <p>How Modules are Loaded 341</p> <p>Import/Export Syntax Review 348</p> <p>Dynamic Import 350</p> <p>Tree Shaking 357</p> <p>Bundling 359</p> <p>Import Metadata 360</p> <p>Worker Modules 360</p> <p>Old Habits to New 362</p> <p><b>Chapter 14: Reflection—Reflect and Proxy 365</b></p> <p>Reflect 365</p> <p>Proxy 371</p> <p>Old Habits to New 395</p> <p><b>Chapter 15: Regular Expression Updates 397</b></p> <p>The Flags Property 398</p> <p>New Flags 398</p> <p>Named Capture Groups 400</p> <p>Lookbehind Assertions 405</p> <p>Unicode Features 408</p> <p>Old Habits to New 413</p> <p><b>Chapter 16: Shared Memory 417</b></p> <p>Introduction 417</p> <p>Here There Be Dragons! 418</p> <p>Browser Support 418</p> <p>Shared Memory Basics 420</p> <p>Memory is Shared, Not Objects 426</p> <p>Race Conditions, Out-of-Order Stores, Stale Values, Tearing, and More 427</p> <p>The Atomics Object 429</p> <p>Shared Memory Example 434</p> <p>Here There Be Dragons! (Again) 455</p> <p>Old Habits to New 460</p> <p><b>Chapter 17: Miscellany 461</b></p> <p>BigInt 462</p> <p>New Integer Literals 465</p> <p>New Math Methods 467</p> <p>Exponentiation Operator (**) 468</p> <p>Date.prototype.toString Change 470</p> <p>Function.prototype.toString Change 471</p> <p>Number Additions 471</p> <p>Symbol.isConcatSpreadable 474</p> <p>Various Syntax Tweaks 475</p> <p>Various Standard Library / Global Additions 479</p> <p>Annex B: Browser-Only Features 482</p> <p>Tail Call Optimization 488</p> <p>Old Habits to New 491</p> <p><b>Chapter 18: Upcoming Class Features 493</b></p> <p>Public and Private Class Fields, Methods, and Accessors 493</p> <p>Old Habits to New 514</p> <p><b>Chapter 19: A Look Ahead . . .517</b></p> <p>Top-Level await 518</p> <p>WeakRefs and Cleanup Callbacks 525</p> <p>RegExp Match Indices 533</p> <p>String.prototype.replaceAll 535</p> <p>Atomics asyncWait 535</p> <p>Various Syntax Tweaks 536</p> <p>Legacy Deprecated RegExp Features 537</p> <p>Thank You for Reading! 538</p> <p><b>Appendix: Fantastic Features and Where to Find Them 539</b></p> <p>Index 557</p>
<p>About the author</p> <p><b>T.J. Crowder</b> is a software engineer with 30 years of experience, including over 15 years of professional work in JavaScript. He runs Farsight Software, a software contracting and product company. He's often found helping people on Stack Overflow, where he's a top 10 all-time contributor and <i>the</i> top JavaScript contributor. When not working or writing, he…no, sorry, he's always working or writing – or spending time with his wonderful, supportive wife and fantastic son.</p> <p>Visit us at www.wiley.com for free code samples.</p>
<p><b>All of JavaScript's newest features, in depth, made easy to understand</b> <p>JavaScript is a rapidly changing language and it can be challenging for experienced developers to keep up with all the new toys being added. This book explores the newest features of the world's most popular programming language while also showing readers how to track what's coming next. After setting the stage by covering who manages the process of improving JavaScript, how new features get introduced, terminology, and a high-level overview of new features, it details each new or updated item in depth, with example uses, possible pitfalls, and expert recommendations for updating old habits in light of new features. <p><i>JavaScript: The New Toys:</i> <ul> <li>Covers all the additions to JavaScript in ES2015-ES2020 plus a preview of what's coming next</li> <li>Explores the latest syntax: nullish coalescing, optional chaining, let and const, class syntax, private methods, private fields, new.target, numeric separators, BigInt, destructuring, default parameters, arrow functions, async functions, await, generator functions, ... (rest and spread), template literals, binary and octal literals, ** (exponentiation), computed property/method names, for-of, for-await-of, shorthand properties, and more</li> <li>Details the new features and patterns: modules, promises, iteration, generators, Symbol, Proxy, reflection, typed arrays, Atomics, shared memory, WeakMap, and WeakSet to name just a few</li> <li>Highlights common pitfalls and explains how to avoid them</li> <li>Shows how to follow – and participate in – the improvements process</li> <li>Explains how to use new features even before they're widely supported</li> </ul> <p><b>Wrox Professional guides</b> are written by working developers to address everyday needs. They provide examples, practical solutions, and expert education in new technologies, all designed to help experienced programmers do a better job.

Diese Produkte könnten Sie auch interessieren:

Distributed Object-Oriented Architectures
Distributed Object-Oriented Architectures
von: Josef Stepisnik
PDF ebook
58,00 €
Web 2.0
Web 2.0
von: Hannes Duschinski
PDF ebook
48,00 €
Streaming-Video und Web-TV
Streaming-Video und Web-TV
von: Michael Bösken
PDF ebook
48,00 €