JavaScript: The Definitive Guide, 7th Edition

Book Description

For web developers and other programmers interested in using JavaScript, this bestselling book provides the most comprehensive JavaScript reference section on the market. The seventh edition represents a significant update, with new material for ECMAScript 2017 (ES8), and new chapters on language-specific features.

JavaScript: The Definitive Guide is ideal for experienced programmers who want to learn the programming language of the web, and for current JavaScript programmers who want to master it.

Table of Contents

  1. Introduction to JavaScript
    1. 1.1 Exploring JavaScript
    2. 1.2 Hello World
    3. 1.3 A Tour of JavaScript
    4. 1.4 A Final Example
    5. 1.5 Summary
  2. Lexical Structure
    1. 2.1 The Text of a JavaScript Program
    2. 2.2 Comments
    3. 2.3 Literals
    4. 2.4 Identifiers and Reserved Words
      1. 2.4.1 Reserved Words
    5. 2.5 Unicode
      1. 2.5.1 Unicode Escape Sequences
      2. 2.5.2 Unicode Normalization
    6. 2.6 Optional Semicolons
    7. 2.7 Summary
  3. Types, Values, and Variables
    1. 3.0 Introduction
    2. 3.1 Numbers
      1. 3.2.1 Integer Literals
      2. 3.2.2 Floating-Point Literals
      3. 3.2.3 Arithmetic in JavaScript
      4. 3.2.4 Binary Floating-Point and Rounding Errors
      5. 3.2.5 Arbitrary Precision Integers with BigInt
      6. 3.2.6 Dates and Times
    3. 3.2 Text
      1. 3.3.1 String Literals
      2. 3.3.2 Escape Sequences in String Literals
      3. 3.3.3 Working with Strings
      4. 3.3.4 Template Literals
      5. 3.3.5 Pattern Matching
    4. 3.3 Boolean Values
    5. 3.4 null and undefined
    6. 3.5 Symbols
    7. 3.6 The Global Object
    8. 3.7 Immutable Primitive Values and Mutable Object References
    9. 3.8 Type Conversions
      1. 3.9.1 Conversions and Equality
      2. 3.9.2 Explicit Conversions
      3. 3.9.3 Object to Primitive Conversions
    10. 3.9 Variable Declaration and Assignment
      1. 3.10.1 Declarations with let and const
      2. 3.10.2 Variable Declarations with var
      3. 3.10.3 Destructuring Assignment
    11. 3.10 Summary
  4. Expressions and Operators
    1. 4.1 Primary Expressions
    2. 4.2 Object and Array Initializers
    3. 4.3 Function Definition Expressions
    4. 4.4 Property Access Expressions
    5. 4.5 Invocation Expressions
    6. 4.6 Object Creation Expressions
    7. 4.7 Operator Overview
      1. 4.7.1 Number of Operands
      2. 4.7.2 Operand and Result Type
      3. 4.7.3 Lvalues
      4. 4.7.4 Operator Side Effects
      5. 4.7.5 Operator Precedence
      6. 4.7.6 Operator Associativity
      7. 4.7.7 Order of Evaluation
    8. 4.8 Arithmetic Expressions
      1. 4.8.1 The + Operator
      2. 4.8.2 Unary Arithmetic Operators
      3. 4.8.3 Bitwise Operators
    9. 4.9 Relational Expressions
      1. 4.9.1 Equality and Inequality Operators
      2. 4.9.2 Comparison Operators
      3. 4.9.3 The in Operator
      4. 4.9.4 The instanceof Operator
    10. 4.10 Logical Expressions
      1. 4.10.1 Logical AND (&&)
      2. 4.10.2 Logical OR (||)
      3. 4.10.3 Logical NOT (!)
    11. 4.11 Assignment Expressions
      1. 4.11.1 Assignment with Operation
    12. 4.12 Evaluation Expressions
      1. 4.12.1 eval()
      2. 4.12.2 Global eval()
      3. 4.12.3 Strict eval()
    13. 4.13 Miscellaneous Operators
      1. 4.13.1 The Conditional Operator (?:)
      2. 4.13.2 The typeof Operator
      3. 4.13.3 The delete Operator
      4. 4.13.4 The await Operator
      5. 4.13.5 The void Operator
      6. 4.13.6 The Comma Operator (,)
    14. 4.14 Summary
  5. Statements
    1. 5.1 Expression Statements
    2. 5.2 Compound and Empty Statements
    3. 5.3 Conditionals
      1. 5.3.1 if
      2. 5.3.2 else if
      3. 5.3.3 switch
    4. 5.4 Loops
      1. 5.4.1 while
      2. 5.4.2 do/while
      3. 5.4.3 for
      4. 5.4.4 for/of
      5. 5.4.5 for/in
    5. 5.5 Jumps
      1. 5.5.1 Labeled Statements
      2. 5.5.2 break
      3. 5.5.3 continue
      4. 5.5.4 return
      5. 5.5.5 yield
      6. 5.5.6 throw
      7. 5.5.7 try/catch/finally
    6. 5.6 Miscellaneous Statements
      1. 5.6.1 with
      2. 5.6.2 debugger
      3. 5.6.3 “use strict”
    7. 5.7 Declarations
      1. 5.7.1 const, let and var
      2. 5.7.2 function
      3. 5.7.3 class
      4. 5.7.4 import and export
    8. 5.8 Summary of JavaScript Statements
  6. Objects
    1. 6.1 Introduction to Objects
    2. 6.2 Creating Objects
      1. 6.2.1 Object Literals
      2. 6.2.2 Creating Objects with new
      3. 6.2.3 Prototypes
      4. 6.2.4 Object.create()
    3. 6.3 Querying and Setting Properties
      1. 6.3.1 Objects As Associative Arrays
      2. 6.3.2 Inheritance
      3. 6.3.3 Property Access Errors
    4. 6.4 Deleting Properties
    5. 6.5 Testing Properties
    6. 6.6 Enumerating Properties
      1. 6.6.1 Property Enumeration Order
    7. 6.7 Extending Objects
    8. 6.8 Serializing Objects
    9. 6.9 Object Methods
      1. 6.9.1 The toString() Method
      2. 6.9.2 The toLocaleString() Method
      3. 6.9.3 The valueOf() Method
      4. 6.9.4 The toJSON() Method
    10. 6.10 Extended Object Literal Syntax
      1. 6.10.1 Shorthand Properties
      2. 6.10.2 Computed Property Names
      3. 6.10.3 Symbols as Property Names
      4. 6.10.4 Spread Operator
      5. 6.10.5 Shorthand Methods
      6. 6.10.6 Property Getters and Setters
    11. 6.11 Summary
  7. Arrays
    1. 7.1 Creating Arrays
      1. 7.1.1 Array Literals
      2. 7.1.2 The Spread Operator
      3. 7.1.3 The Array() Constructor
      4. 7.1.4 Array.of()
      5. 7.1.5 Array.from()
    2. 7.2 Reading and Writing Array Elements
    3. 7.3 Sparse Arrays
    4. 7.4 Array Length
    5. 7.5 Adding and Deleting Array Elements
    6. 7.6 Iterating Arrays
    7. 7.7 Multidimensional Arrays
    8. 7.8 Array Methods
      1. 7.8.1 Array Iterator Methods
      2. 7.8.2 Adding arrays with concat()
      3. 7.8.3 Stacks and Queues with push(), pop(), shift() and unshift()
      4. 7.8.4 Subarrays with slice(), splice(), fill() and copyWithin()
      5. 7.8.5 Array Searching and Sorting Methods
      6. 7.8.6 Array to String Conversions
      7. 7.8.7 Static Array Functions
    9. 7.9 Array-Like Objects
    10. 7.10 Strings As Arrays
    11. 7.11 Summary
  8. Functions
    1. 8.1 Defining Functions
      1. 8.1.1 Function Declarations
      2. 8.1.2 Function Expressions
      3. 8.1.3 Arrow Functions
      4. 8.1.4 Nested Functions
    2. 8.2 Invoking Functions
      1. 8.2.1 Function Invocation
      2. 8.2.2 Method Invocation
      3. 8.2.3 Constructor Invocation
      4. 8.2.4 Indirect Invocation
      5. 8.2.5 Implicit Function Invocation
    3. 8.3 Function Arguments and Parameters
      1. 8.3.1 Optional Parameters and Defaults
      2. 8.3.2 Rest Parameters and Variable-Length Argument Lists
      3. 8.3.3 The Arguments Object
      4. 8.3.4 The Spread Operator for Function Calls
      5. 8.3.5 Destructuring Function Arguments into Parameters
      6. 8.3.6 Argument Types
    4. 8.4 Functions As Values
      1. 8.4.1 Defining Your Own Function Properties
    5. 8.5 Functions As Namespaces
    6. 8.6 Closures
    7. 8.7 Function Properties, Methods, and Constructor
      1. 8.7.1 The length Property
      2. 8.7.2 The name Property
      3. 8.7.3 The prototype Property
      4. 8.7.4 The call() and apply() Methods
      5. 8.7.5 The bind() Method
      6. 8.7.6 The toString() Method
      7. 8.7.7 The Function() Constructor
    8. 8.8 Functional Programming
      1. 8.8.1 Processing Arrays with Functions
      2. 8.8.2 Higher-Order Functions
      3. 8.8.3 Partial Application of Functions
      4. 8.8.4 Memoization
    9. 8.9 Summary
  9. Classes
    1. 9.1 Classes and Prototypes
    2. 9.2 Classes and Constructors
      1. 9.2.1 Constructors, Class Identity and instanceof
      2. 9.2.2 The constructor Property
    3. 9.3 Classes with the class Keyword
      1. 9.3.1 Static Methods
      2. 9.3.2 Getters, Setters and other Method Forms
      3. 9.3.3 Public, Private and Static Fields
      4. 9.3.4 Example: a Complex Number Class
    4. 9.4 Adding Methods to Existing Classes
    5. 9.5 Subclasses
      1. 9.5.1 Subclasses and Prototypes
      2. 9.5.2 Subclasses with extends and super
      3. 9.5.3 Delegation Instead of Inheritance
      4. 9.5.4 Class Hierarchies and Abstract Classes
    6. 9.6 Summary
  10. Iterators and Generators
    1. 10.1 How iterators work
    2. 10.2 Implementing Iterable Objects
      1. 10.2.1 “Closing” an iterator: the return method
    3. 10.3 Generators
      1. 10.3.1 Generator Examples
      2. 10.3.2 yield* and Recursive Generators
    4. 10.4 Advanced Generator Features
      1. 10.4.1 The Return Value of a Generator Function
      2. 10.4.2 The Value of a yield Expression
      3. 10.4.3 The return() and throw() Methods of a Generator
      4. 10.4.4 A Final Note about Generators
    5. 10.5 Summary
  11. Asynchronous JavaScript
    1. 11.1 Asynchronous Programming with Callbacks
      1. 11.1.1 Timers
      2. 11.1.2 Events
      3. 11.1.3 Network Events
      4. 11.1.4 Callbacks and Events in Node
    2. 11.2 Promises
      1. 11.2.1 Using Promises
      2. 11.2.2 Chaining Promises
      3. 11.2.3 Resolving Promises
      4. 11.2.4 More on Promises and Errors
      5. 11.2.5 Promises in Parallel
      6. 11.2.6 Making Promises
      7. 11.2.7 Promises in Sequence
    3. 11.3 async and await
      1. 11.3.1 await Expressions
      2. 11.3.2 async Functions
      3. 11.3.3 Awaiting Multiple Promises
      4. 11.3.4 Implementation Details
    4. 11.4 Asynchronous Iteration
      1. 11.4.1 The for/await Loop
      2. 11.4.2 Asynchronous Iterators
      3. 11.4.3 Asynchronous Generators
      4. 11.4.4 Implementing Asynchronous Iterators
    5. 11.5 Summary

Product Information

  • Title: JavaScript: The Definitive Guide, 7th Edition
  • Author(s): David Flanagan
  • Release date: July 2020
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9781491952016