“Exploring JavaScript” makes the language less challenging to learn for newcomers, by offering a modern view that is as consistent as possible.
Highlights:
- Get started quickly, by initially focusing on modern features.
- Test-driven exercises available for most chapters.
- Covers all essential features of JavaScript, up to and including ES2024.
- Optional advanced sections let you dig deeper.
No prior knowledge of JavaScript is required, but you should know how to program.
- Title
- Exploring JavaScript ES2024 Edition
- Author(s)
- Dr. Axel Rauschmayer
- Published
- 2024-06-22
- Edition
- 1
- Format
- eBook (pdf, epub, mobi)
- Pages
- 405
- Language
- English
- ISBN-13
- 9781091210097
- License
- Read online for free
- Book Homepage
- Free eBook, Errata, Code, Solutions, etc.
I Background 1 Before you buy the book 1.1 About the content 1.2 Previewing and buying this book 1.3 About the author 1.4 Acknowledgements 2 FAQ: book and supplementary material 2.1 How to read this book 2.2 I own a digital version 2.3 I own the print version (“JavaScript for impatient programmers”) 2.4 Notations and conventions 3 Why JavaScript? 3.1 The cons of JavaScript 3.2 The pros of JavaScript 3.3 Pro and con of JavaScript: innovation 4 The nature of JavaScript 4.1 JavaScript’s influences 4.2 The nature of JavaScript 4.3 Tips for getting started with JavaScript 5 History and evolution of JavaScript 5.1 How JavaScript was created 5.2 Standardization: JavaScript vs. ECMAScript 5.3 Timeline of ECMAScript versions 5.4 Evolving JavaScript: TC39 (Ecma Technical Committee 39) 5.5 The TC39 process for proposed ECMAScript features 5.6 How to not break the web while changing JavaScript 5.7 FAQ: ECMAScript and TC39 6 New JavaScript features 6.1 New in ECMAScript 6.2 New in ECMAScript 6.3 New in ECMAScript 6.4 New in ECMAScript 6.5 New in ECMAScript 6.6 New in ECMAScript 6.7 New in ECMAScript 6.8 New in ECMAScript 6.9 New in ECMAScript 6.10 Source of this chapter 7 FAQ: JavaScript 7.1 What are good references for JavaScript? 7.2 How do I find out what JavaScript features are supported where? 7.3 Where can I look up what features are planned for JavaScript? 7.4 Why does JavaScript fail silently so often? 7.5 Why can’t we clean up JavaScript, by removing quirks and outdated features? 7.6 How can I quickly try out a piece of JavaScript code? II First steps 8 Using JavaScript: the big picture 8.1 What are you learning in this book? 8.2 The structure of browsers and Node.js 8.3 JavaScript references 8.4 Further reading 9 Syntax 9.1 An overview of JavaScript’s syntax 9.2 (Advanced) 9.3 Hashbang lines (Unix shell scripts) 9.4 Identifiers 9.5 Statement vs. expression 9.6 Ambiguous syntax 9.7 Semicolons 9.8 Automatic semicolon insertion (ASI) 9.9 Semicolons: best practices 9.10 Strict mode vs. sloppy mode 10 Consoles: interactive JavaScript command lines 10.1 Trying out JavaScript code 10.2 The console.* API: printing data and more 11 Assertion API 11.1 Assertions in software development 11.2 How assertions are used in this book 11.3 Normal comparison vs. deep comparison 11.4 Quick reference: module assert 12 Getting started with exercises 12.1 Exercises 12.2 Unit tests in JavaScript III Variables and values 13 Variables and assignment 13.1 let 13.2 const 13.3 Deciding between const and let 13.4 The scope of a variable 13.5 (Advanced) 13.6 Terminology: static vs. dynamic 13.7 Global variables and the global object 13.8 Declarations: scope and activation 13.9 Closures 14 Values 14.1 What’s a type? 14.2 JavaScript’s type hierarchy 14.3 The types of the language specification 14.4 Primitive values vs. objects 14.5 The operators typeof and instanceof: what’s the type of a value? 14.6 Classes and constructor functions 14.7 Converting between types 15 Operators 15.1 Making sense of operators 15.2 The plus operator (+) 15.3 Assignment operators 15.4 Equality: == vs. === 15.5 Ordering operators 15.6 Various other operators IV Primitive values 16 The non-values undefined and null 16.1 undefined vs. null 16.2 Occurrences of undefined and null 16.3 Checking for undefined or null 16.4 The nullish coalescing operator (??) for default values [ES2020] 16.5 undefined and null don’t have properties 16.6 The history of undefined and null 17 Booleans 17.1 Converting to boolean 17.2 Falsy and truthy values 17.3 Truthiness-based existence checks 17.4 Conditional operator (? :) 17.5 Binary logical operators: And (x && y), Or (x || y) 17.6 Logical Not (!) 18 Numbers 18.1 Numbers are used for both floating point numbers and integers 18.2 Number literals 18.3 Arithmetic operators 18.4 Converting to number 18.5 Error values 18.6 The precision of numbers: careful with decimal fractions 18.7 (Advanced) 18.8 Background: floating point precision 18.9 Integer numbers in JavaScript 18.10 Bitwise operators 18.11 Quick reference: numbers 19 Math 19.1 Data properties 19.2 Exponents, roots, logarithms 19.3 Rounding 19.4 Trigonometric Functions 19.5 Various other functions 19.6 Sources 20 Bigints – arbitrary-precision integers [ES2020] (advanced) 20.1 Why bigints? 20.2 Bigints 20.3 Bigint literals 20.4 Reusing number operators for bigints (overloading) 20.5 The wrapper constructor BigInt 20.6 Coercing bigints to other primitive types 20.7 TypedArrays and DataView operations for 64-bit values 20.8 Bigints and JSON 20.9 FAQ: Bigints 21 Unicode – a brief introduction (advanced) 21.1 Code points vs. code units 21.2 Encodings used in web development: UTF-16 and UTF-8 21.3 Grapheme clusters – the real characters 22 Strings 22.1 Cheat sheet: strings 22.2 Plain string literals 22.3 Accessing JavaScript characters 22.4 String concatenation 22.5 Converting to string 22.6 Comparing strings 22.7 Atoms of text: code points, JavaScript characters, grapheme clusters 22.8 Quick reference: Strings 23 Using template literals and tagged templates [ES6] 23.1 Disambiguation: “template” 23.2 Template literals 23.3 Tagged templates 23.4 Examples of tagged templates (as provided via libraries) 23.5 Raw string literals 23.6 (Advanced) 23.7 Multiline template literals and indentation 23.8 Simple templating via template literals 24 Symbols [ES6] 24.1 Symbols are primitives that are also like objects 24.2 The descriptions of symbols 24.3 Use cases for symbols 24.4 Publicly known symbols 24.5 Converting symbols V Control flow and data flow 25 Control flow statements 25.1 Controlling loops: break and continue 25.2 Conditions of control flow statements 25.3 if statements [ES1] 25.4 switch statements [ES3] 25.5 while loops [ES1] 25.6 do-while loops [ES3] 25.7 for loops [ES1] 25.8 for-of loops [ES6] 25.9 for-await-of loops [ES2018] 25.10 for-in loops (avoid) [ES1] 25.11 Recomendations for looping 26 Exception handling 26.1 Motivation: throwing and catching exceptions 26.2 throw 26.3 The try statement 26.4 Error and its subclasses 26.5 Chaining errors 27 Callable values 27.1 Kinds of functions 27.2 Ordinary functions 27.3 Specialized functions [ES6] 27.4 Summary: kinds of callable values 27.5 Returning values from functions and methods 27.6 Parameter handling 27.7 Methods of functions: .call(), .apply(), .bind() 28 Evaluating code dynamically: eval(), new Function() (advanced) 28.1 eval() 28.2 new Function() 28.3 Recommendations VI Modularity 29 Modules [ES6] 29.1 Cheat sheet: modules 29.2 JavaScript source code formats 29.3 Before we had modules, we had scripts 29.4 Module systems created prior to ES6 29.5 ECMAScript modules 29.6 Named exports and imports 29.7 Default exports and imports 29.8 Re-exporting 29.9 More details on exporting and importing 29.10 npm packages 29.11 Naming modules 29.12 Module specifiers 29.13 import.meta – metadata for the current module [ES2020] 29.14 Loading modules dynamically via import() [ES2020] (advanced) 29.15 Top-level await in modules [ES2022] (advanced) 29.16 Polyfills: emulating native web platform features (advanced) 30 Objects 30.1 Cheat sheet: objects 30.2 What is an object? 30.3 Fixed-layout objects 30.4 Spreading into object literals (...) [ES2018] 30.5 Methods and the special variable this 30.6 Optional chaining for property getting and method calls [ES2020] (advanced) 30.7 Dictionary objects (advanced) 30.8 Property attributes and property descriptors [ES5] (advanced) 30.9 Protecting objects from being changed [ES5] (advanced) 30.10 Prototype chains 30.11 FAQ: objects 30.12 Quick reference: Object 30.13 Quick reference: Reflect 31 Classes [ES6] 31.1 Cheat sheet: classes 31.2 The essentials of classes 31.3 The internals of classes 31.4 Prototype members of classes 31.5 Instance members of classes [ES2022] 31.6 Static members of classes 31.7 Subclassing 31.8 The methods and accessors of Object.prototype (advanced) 31.9 FAQ: classes VII Collections 32 Synchronous iteration [ES6] 32.1 What is synchronous iteration about? 32.2 Core iteration constructs: iterables and iterators 32.3 Iterating manually 32.4 Iteration in practice 32.5 Grouping iterables [ES2024] 32.6 Example: grouping by property value 32.7 Quick reference: synchronous iteration 33 Arrays (Array) 33.1 Cheat sheet: Arrays 33.2 Ways of using Arrays: fixed layout vs. sequence 33.3 Basic Array operations 33.4 for-of and Arrays 33.5 Array-like objects 33.6 Converting iterables and Array-like values to Arrays 33.7 Creating and filling Arrays with arbitrary lengths 33.8 Multidimensional Arrays 33.9 Arrays are actually dictionaries (advanced) 33.10 Destructive vs. non-destructive Array operations 33.11 Adding and removing elements at either end of an Array 33.12 Array methods that accept element callbacks 33.13 Transforming with element callbacks: .map(), .filter(), .flatMap() 33.14 .reduce(): computing a summary for an Array 33.15 .sort(): sorting Arrays 33.16 Arrays can use operations for iterables 33.17 Quick reference: Array 34 Typed Arrays: handling binary data [ES6] (advanced) 34.1 An overview of the API 34.2 Using Typed Arrays 34.3 Using DataViews 34.4 Element types 34.5 Converting to and from Typed Arrays 34.6 Resizing ArrayBuffers [ES2024] 34.7 Transferring and detaching ArrayBuffers [ES2024] 34.8 Quick references: indices vs. offsets 34.9 Quick reference: ArrayBuffers 34.10 Quick reference: Typed Arrays 34.11 Quick reference: DataViews 35 Maps (Map) [ES6] 35.1 Using Maps 35.2 Example: Counting characters 35.3 A few more details about the keys of Maps (advanced) 35.4 Missing Map operations 35.5 Quick reference: Map 35.6 FAQ: Maps 36 WeakMaps (WeakMap) [ES6] (advanced) 36.1 WeakMaps are black boxes 36.2 The keys of a WeakMap are weakly held 36.3 Attaching values to objects via WeakMaps 36.4 Quick reference: WeakMap 37 Sets (Set) [ES6] 37.1 Using Sets 37.2 Examples of using Sets 37.3 What Set elements are considered equal? 37.4 Missing Set operations 37.5 Sets can use operations for iterables 37.6 Quick reference: Set 37.7 FAQ: Sets 38 WeakSets (WeakSet) [ES6] (advanced) 38.1 Example: Marking objects as safe to use with a method 38.2 WeakSet API 39 Destructuring [ES6] 39.1 A first taste of destructuring 39.2 Constructing vs. extracting 39.3 Where can we destructure? 39.4 Object-destructuring 39.5 Array-destructuring 39.6 Examples of destructuring 39.7 What happens if a pattern part does not match anything? 39.8 What values can’t be destructured? 39.9 (Advanced) 39.10 Default values 39.11 Parameter definitions are similar to destructuring 39.12 Nested destructuring 40 Synchronous generators [ES6] (advanced) 40.1 What are synchronous generators? 40.2 Calling generators from generators (advanced) 40.3 Background: external iteration vs. internal iteration 40.4 Use case for generators: reusing traversals 40.5 Advanced features of generators VIII Asynchronicity 41 Foundations of asynchronous programming in JavaScript 41.1 A roadmap for asynchronous programming in JavaScript 41.2 The call stack 41.3 The event loop 41.4 How to avoid blocking the JavaScript process 41.5 Patterns for delivering asynchronous results 41.6 Asynchronous code: the downsides 41.7 Resources 42 Promises for asynchronous programming [ES6] 42.1 The basics of using Promises 42.2 Examples 42.3 Error handling: don’t mix rejections and exceptions 42.4 Promise-based functions start synchronously, settle asynchronously 42.5 Promise combinator functions: working with Arrays of Promises 42.6 Concurrency and Promise.all() (advanced) 42.7 Tips for chaining Promises 42.8 Quick reference: Promise combinator functions 43 Async functions [ES2017] 43.1 Async functions: the basics 43.2 Returning from async functions 43.3 await: working with Promises 43.4 (Advanced) 43.5 Concurrency and await 43.6 Tips for using async functions 44 Asynchronous iteration [ES2018] 44.1 Basic asynchronous iteration 44.2 Asynchronous generators 44.3 Async iteration over Node.js streams IX More standard library 45 Regular expressions (RegExp) 45.1 Creating regular expressions 45.2 Syntax characters and escaping 45.3 Syntax: atoms of regular expressions 45.4 Syntax: character class escapes 45.5 Syntax: character classes 45.6 Syntax: capture groups 45.7 Syntax: quantifiers 45.8 Syntax: assertions 45.9 Syntax: disjunction (|) 45.10 Regular expression flags 45.11 Properties of regular expression objects 45.12 Match objects 45.13 Methods for working with regular expressions 45.14 The flags /g and /y, and the property .lastIndex (advanced) 45.15 Techniques for working with regular expressions 46 Dates (Date) 46.1 Best practice: avoid the built-in Date 46.2 Time standards 46.3 Background: date time formats (ISO) 46.4 Time values 46.5 Creating Dates 46.6 Getters and setters 46.7 Converting Dates to strings 47 Creating and parsing JSON (JSON) 47.1 The discovery and standardization of JSON 47.2 JSON syntax 47.3 Using the JSON API 47.4 Customizing stringification and parsing (advanced) 47.5 FAQ X Miscellaneous topics 48 Next steps: overview of web development 48.1 Tips against feeling overwhelmed 48.2 Things worth learning for web development 48.3 An overview of JavaScript tools 48.4 Tools not related to JavaScript XI Appendices A Index
Related Books