Theseventh edition of my book, JavaScript: The Definitive Guide isscheduled for release less than a month from today. If you own thesixth edition, it is very much time for an upgrade. This post explainswhat has changed in this new edition.
Most importantly, this edition is up-to-date and covers the verynewest ES2020 features like ?. and ??. The sixth edition coveredES5, which means that I have added documentation of all the languagefeatures of ES6, ES2016, ES2017, ES2018, ES2019 and ES2020 for thisupdate.
Chapter 6, Objects, and Chapter 8, Functions, are notcompletely rewritten but they include a lot of new materialcovering all the ES6 extensions to object literal syntax, arrowfunctions, parameter defaults, rest parameters, the spreadoperator, and so on.
Chapter 9, Classes, is entirely rewritten. The chapter beginsthe old fashioned way: it demonstrates how to create a JavaScriptclass by directly defining methods on the prototype object. Ibelieve that it is still important to understand how classesactually work in JavaScript. But after some initial examples ofthis technique, the chapter switches to using the modern classkeyword.
Chapter 10, Modules, is new. When I wrote the 6th edition,JavaScript had no module system and my discussion of usingimmediately-invoked function expressions as modules was simplytacked on to the end of the classes chapters. This new chapterdocuments both the module system used by Node and the ES6-standardmodules that are now (finally!) supported by all browsers.
Chapter 11, The JavaScript Standard Library, is a new chapterthat covers maps, sets, typed arrays, dates, errors, JSON, andinternationalization. The existing chapter on regular expressionsfrom the 6th edition has been updated and turned into a (long)section of this chapter. This chapter also covers three APIs thatare not formally part of the JavaScript language, but that areimplemented by browsers and by Node: the console API, the URLclass, and the setTimeout() and setInterval() functions.
Chapter 12, Iterators and Generators is new, and documentsexactly what the title says. This chapter teaches you how to useSymbol.iterator to make your own classes iterable so that theywork with the for/of loop. And it also explains generator(defined with function*) and the yield and yield* keywords.
Chapter 13, Asynchronous JavaScript is a detailed discussion ofasynchronous APIs and explains how to use events, callbacks,Promises, and async and await. Promises are a revolutionaryaddition to JavaScript, but using them correctly can be hardunless you understand them thoroughly. This chapter goes deep inan attempt to definitively explain Promises.
Chapter 14, Metaprogramming is a grab-bag of advanced languagefeatures that may be of primary interest to those writinglibraries for use by other programmers. It explains propertydescriptors, object extensibility, template tag functions, proxyobjects, the Reflect API and well-known symbols.
Chapter 15, JavaScript in Web Browsers is by far the longestchapter in the book, introducing the Web platform in 160 pages. Itincludes the content from the 6th edition that is still relevant,plus new material covering web components, fetch(),history.pushState() and more. This chapter concludes with anextended example that implements a multi-threaded Mandelbrot setviewer app. The example demonstrates web workers (and includes aPromise-based WorkerPool utility class), inter-threadcommunication with postMessage(), the transfer (without copying)of array buffers between threads, history management withpushState() and popstate(), keyboard and pointer events,scripted CSS transforms, the URL() class, and generators.
Chapter 16, Server-Side JavaScript with Node, is a detailedintroduction to Node that starts with the fundamentals: events,buffers, and streams. This is followed by practical sections onworking with files, making HTTP requests, serving HTTPresponses, and concurrent programming with threads and childprocesses.
JavaScript is the programming language of the web and is used by more software developers today than any other programming language. For nearly 25 years this best seller has been the go-to guide for JavaScript programmers. The seventh edition is fully updated to cover the 2020 version of JavaScript, and new chapters cover classes, modules, iterators, generators, Promises, async/await, and metaprogramming. You'll find illuminating and engaging example code throughout. This book is for programmers who want to learn JavaScript and for web developers who want to take their understanding and mastery to the next level. It begins by explaining the JavaScript language itself, in detail, from the bottom up. It then builds on that foundation to cover the web platform and Node.js. Topics include: Types, values, variables, expressions, operators, statements, objects, and arrays Functions, classes, modules, iterators, generators, Promises, and async/await JavaScript's standard library: data structures, regular expressions, JSON, i18n, etc. The web platform: documents, components, graphics, networking, storage, and threads Node.js: buffers, files, streams, threads, child processes, web clients, and web servers Tools and language extensions that professional JavaScript developers rely on
Since 1996, JavaScript: The Definitive Guide has been the bible for JavaScript programmers--a programmer's guide and comprehensive reference to the core language and to the client-side JavaScript APIs defined by web browsers.
The 6th edition covers HTML5 and ECMAScript 5. Many chapters have been completely rewritten to bring them in line with today's best web development practices. New chapters in this edition document jQuery and server side JavaScript. It's recommended for experienced programmers who want to learn the programming language of the Web, and for current JavaScript programmers who want to master it.
3a8082e126