Название: jаvascript for impatient programmers (ECMAScript 2021 edition) Автор: Rauschmayer Axel Издательство: Independently published Год: 2021 Формат: pdf Страниц: 576 Размер: 44 mb Язык: english
This book makes jаvascript less challenging to learn for newcomers by offering a modern view that is as consistent as possible.
Get started quickly by initially focusing on modern features. Test-driven exercises and quizzes available for most chapters. Covers all essential features of jаvascript, up to and including ES2021. Optional advanced sections let you dig deeper. No prior knowledge of jаvascript is required, but you should know how to program. Background Before you buy the book About the content Previewing and buying this book About the author Acknowledgements FAQ: book and supplementary material How to read this book own a digital version own the print version Notations and conventions Why jаvascript? (bonus) The cons of jаvascript The pros of jаvascript Pro and con of jаvascript: innovation The nature of jаvascript (bonus) jаvascript’s influences The nature of jаvascript Tips for getting started with jаvascript History and evolution of jаvascript How jаvascript was created Standardizing jаvascript Timeline of ECMAScript versions Ecma Technical Committee 39 (TC39) The TC39 process FAQ: TC39 process Evolving jаvascript: Don’t break the web New jаvascript features New in ECMAScript 2021 New in ECMAScript 2020 New in ECMAScript 2019 New in ECMAScript 2018 New in ECMAScript 2017 New in ECMAScript 2016 Source of this chapter FAQ: jаvascript What are good references for jаvascript? How do I find out what jаvascript features are supported where? Where can I look up what features are planned for jаvascript? Why does jаvascript fail silently so often? Why can’t we clean up jаvascript, by removing quirks and outdated features? How can I quickly try out a piece of jаvascript code? First steps Using jаvascript: the big picture What are you learning in this book? The structure of browsers and Node.js jаvascript references Further reading Syntax An overview of jаvascript’s syntax (Advanced) Identifiers Statement vs. expression Ambiguous syntax Semicolons Automatic semicolon insertion (ASI) Semicolons: best practices Strict mode vs. sloppy mode Consoles: interactive jаvascript command lines Trying out jаvascript code The console.* API: printing data and more Assertion API Assertions in software development How assertions are used in this book Normal comparison vs. deep comparison Quick reference: module assert Getting started with quizzes and exercises Quizzes Exercises Unit tests in jаvascript Variables and values Variables and assignment let const Deciding between const and let The scope of a variable (Advanced) Terminology: static vs. dynamic Global variables and the global object Declarations: scope and activation Closures Values What’s a type? jаvascript’s type hierarchy The types of the language specification Primitive values vs. objects The operators typeof and instanceof: what’s the type of a value? Classes and constructor functions Converting between types Operators Making sense of operators The plus operator (+) Assignment operators Equality: == vs. === Ordering operators Various other operators Primitive values The non-values undefined and null undefined vs. null Occurrences of undefined and null Checking for undefined or null The nullish coalescing operator (?) for default values [ES2020] undefined and null don’t have properties The history of undefined and null Booleans Converting to boolean Falsy and truthy values Truthiness-based existence checks Conditional operator (? :) Binary logical operators: And (x && y), Or (x || y) Logical Not (!) Numbers Numbers are used for both floating point numbers and integers Number literals Arithmetic operators Converting to number Error values The precision of numbers: careful with decimal fractions (Advanced) Background: floating point precision Integer numbers in jаvascript Bitwise operators Quick reference: numbers Math Data properties Exponents, roots, logarithms Rounding Trigonometric Functions Various other functions Sources Bigints – arbitrary-precision integers [ES2020] (advanced) Why bigints? Bigints Bigint literals Reusing number operators for bigints (overloading) The wrapper constructor BigInt Coercing bigints to other primitive types TypedArrays and DataView operations for 64-bit values Bigints and JSON FAQ: Bigints Unicode – a brief introduction (advanced)[/b] Code points vs. code units Encodings used in web development: UTF-16 and UTF-8 Grapheme clusters – the real characters [b]Strings Plain string literals Accessing characters and code points String concatenation via + Converting to string Comparing strings Atoms of text: Unicode characters, jаvascript characters, grapheme clusters Quick reference: Strings Using template literals and tagged templates Disambiguation: “template” Template literals Tagged templates Examples of tagged templates (as provided via libraries) Raw string literals (Advanced) Multiline template literals and indentation Simple templating via template literals Symbols Symbols are primitives that are also like objects The descriptions of symbols Use cases for symbols Publicly known symbols Converting symbols Control flow and data flow Control flow statements Controlling loops: break and continue Conditions of control flow statements if statements [ES1] switch statements [ES3] while loops [ES1] do-while loops [ES3] for loops [ES1] for-of loops [ES6] for-await-of loops [ES2018] for-in loops (avoid) [ES1] Recomendations for looping Exception handling Motivation: throwing and catching exceptions throw The try statement Error classes Callable values Kinds of functions Ordinary functions Specialized functions Summary: kinds of callable values Returning values from functions and methods Parameter handling Methods of functions: .call(), .apply(), .bind() Evaluating code dynamically: eval(), new Function() (advanced) eval() new Function() Recommendations Modularity Modules Overview: syntax of ECMAScript modules jаvascript source code formats Before we had modules, we had scripts Module systems created prior to ES6 ECMAScript modules Named exports and imports Default exports and imports More details on exporting and importing npm packages Naming modules Module specifiers Loading modules dynamically via import() [ES2020] import.meta – metadata for the current module [ES2020] Polyfills: emulating native web platform features (advanced) Single objects What is an object? Objects as records Spreading into object literals (...) [ES2018] Methods and the special variable this Optional chaining for property accesses and method calls [ES2020] (advanced) Objects as dictionaries (advanced) Standard methods (advanced) Advanced topics Prototype chains and classes Prototype chains Classes Private data for classes Subclassing FAQ: objects Collections Synchronous iteration What is synchronous iteration about? Core iteration constructs: iterables and iterators Iterating manually Iteration in practice Quick reference: synchronous iteration Arrays (Array) The two roles of Arrays in jаvascript Basic Array operations for-of and Arrays [ES6] Array-like objects Converting iterable and Array-like values to Arrays Creating and filling Arrays with arbitrary lengths Multidimensional Arrays More Array features (advanced) Adding and removing elements (destructively and non-destructively) Methods: iteration and transformation (.find(), .map(), .filter(), etc.) sort(): sorting Arrays Quick reference: Array Typed Arrays: handling binary data (advanced) The basics of the API Element types More information on Typed Arrays Quick references: indices vs. offsets Quick reference: ArrayBuffers Quick reference: Typed Arrays Quick reference: DataViews Maps (Map) Using Maps Example: Counting characters A few more details about the keys of Maps (advanced) Missing Map operations Quick reference: Map FAQ: Maps WeakMaps (WeakMap) (advanced) WeakMaps are black boxes The keys of a WeakMap are weakly held Examples WeakMap API Sets (Set) Using Sets Examples of using Sets What Set elements are considered equal? Missing Set operations Quick reference: Set FAQ: Sets WeakSets (WeakSet) (advanced) Example: Marking objects as safe to use with a method WeakSet API Destructuring A first taste of destructuring Constructing vs. extracting Where can we destructure? Object-destructuring
Array-destructuringExamples of destructuring What happens if a pattern part does not match anything? What values can’t be destructured? (Advanced) Default values Parameter definitions are similar to destructuring Nested destructuring Synchronous generators (advanced) What are synchronous generators? Calling generators from generators (advanced) Background: external iteration vs. internal iteration Use case for generators: reusing traversals Advanced features of generators Asynchronicity Asynchronous programming in jаvascript A roadmap for asynchronous programming in jаvascript The call stack The event loop How to avoid blocking the jаvascript process Patterns for delivering asynchronous results Asynchronous code: the downsides Resources Promises for asynchronous programming [ES6] The basics of using Promises Examples Error handling: don’t mix rejections and exceptions Promise-based functions start synchronously, settle asynchronously Promise combinator functions: working with Arrays of Promises Concurrency and Promise.all() (advanced) Tips for chaining Promises Quick reference: Promise combinator functions Async functions Async functions: the basics Returning from async functions await: working with Promises (Advanced) Immediately invoked async arrow functions Concurrency and await Tips for using async functions Asynchronous iteration Basic asynchronous iteration Asynchronous generators Async iteration over Node.js streams More standard library Regular expressions (RegExp) Creating regular expressions Syntax Flags Properties of regular expression objects Methods for working with regular expressions The flags /g and /y, and the property .lastIndex (advanced) Techniques for working with regular expressions Dates (Date) Best practice: avoid the built-in Date Time standards Background: date time formats (ISO) Time values Creating Dates Getters and setters Converting Dates to strings Creating and parsing JSON (JSON) The discovery and standardization of JSON JSON syntax Using the JSON API Customizing stringification and parsing (advanced) FAQ Miscellaneous topics Next steps: overview of web development (bonus) Tips against feeling overwhelmed Things worth learning for web development Example: tool-based jаvascript workflow An overview of jаvascript tools Tools not related to jаvascript Appendices Index
Внимание
Уважаемый посетитель, Вы зашли на сайт как незарегистрированный пользователь.
Мы рекомендуем Вам зарегистрироваться либо войти на сайт под своим именем.
Информация
Посетители, находящиеся в группе Гости, не могут оставлять комментарии к данной публикации.