Contents
- Getting started
- Comments
- Basic data types
- Built-in constants
- Variables
- Declarations and assignments
- Reserved keywords
- Data types in JavaScript
- Strings
- Basic info and string concatenation
- Reverse a string
- Access character at index in string
- Comparing strings lexicographically
- Word counter
- Escaping quotes
- Splitting a string into an array
- Strings are unicode
- Detecting a string
- Trim whitespace
- Character code
- String representations of numbers
- Substring with slice
- Find and replace
- Find the index of a substring inside a string
- String to lower case
- Repeat a string
- String to upper case
- Escape sequences
- Template Literals
- Arrays
- Converting Array-like Objects to Arrays
- Reducing values
- Mapping values
- Filtering Object Arrays
- Sorting Arrays
- Iteration
- Removing duplicate elements
- Destructuring an array
- Array comparison
- Reversing arrays
- Concatenating Arrays
- Shallow cloning an array
- Merge two array as key value pair
- Array spread rest
- Finding the minimum or maximum element
- Removing items from an array
- Filtering values
- Standard array initialization
- Removing all elements
- Searching an Array
- Convert a String to an Array
- Joining array elements in a string
- Removing / adding elements using splice
- The entries() method
- Remove value from array
- Logical connective of values
- Flattening Arrays
- Object keys and values to array
- Append / prepend items to array
- Checking if an object is an array
- Sorting multidimensional array
- Insert an item into an array at a specific index
- Test all array items for equality
- Copy part of an array with slice()
- Using map to reformat objects in an array
- Objects
- Shallow cloning
- Object.freeze
- Object cloning
- Object properties iteration
- Object.assign
- Object rest / spread (...)
- Accessor properties get and set
- Convert objects values to array
- Dynamic variable property names
- Arrays are Objects
- Object.defineProperty
- Object.seal
- Retrieving properties from an object
- Object.keys
- Descriptors and Named Properties
- Object.getOwnPropertyDescriptor
- Lock property description
- Non enumerable property
- Read-only property
- Creating an iterable object
- Properties with special characters or reserved words
- Iterating entries with Object.entries
- Object.values
- Prototypes objects
- Classes
- Variable coercion / conversion
- Double negation (!!x)
- Implicit conversion
- Convert to boolean
- Convert string to number
- Convert string to boolean
- Convert string to float
- Convert a number to a boolean
- Convert array to a string
- Array to string using array methods
- Integer to Float
- Float to Integer
- Converting a number to a string
- Primitive to primitive conversion table
- Map
- Set
- Arithmetic Math
- Constants
- Remainder Modulus
- Rounding
- Trigonometry
- Bitwise operators
- Increment
- Exponentiation Math.pow or
- Random Integers and Floats
- Addition
- Simulating events with different probabilities
- Little Big endian for typed arrays when using bitwise operators
- Multiplication
- Subtraction (-)
- Random number inside a range
- Decrementing (--)
- Ceiling and floor
- Math.atan2 to find direction of a vector
- Sin / cos to create a vector given direction distance
- 1Math.hypot
- Periodic functions using Math.sin
- Random with gaussian distribution
- Division
- Getting maximum and minimum
- Restrict Number to Min / Max Range
- Getting roots of a number
- Bitwise operators
- Bitwise operators
- Unary Operators
- Comparison operations
- Abstract equality inequality and type conversion
- NaN Property of the Global Object
- Short-circuiting in boolean operators
- Double Negation (!!)
- Abstract equality
- Bitwise operators
- Null and undefined
- Automatic Type Conversions
- Logic Operators with Non-boolean values boolean coercion
- Empty Array
- Logic Operators with Booleans
- Equality comparison operations
- Inequality
- Relational operators
- Grouping multiple logic statements
- List of Comparison Operators
- Bit fields to optimize comparison of multi state data
- Conditions
- Loops
- Functions
- Introduction
- Function Scoping
- Currying
- Immediately Invoked Function Expressions (IIFE)
- Binding this and arguments
- Named Functions
- Variadic function (with arbitrary number of arguments)
- Anonymous Function
- Default parameters
- Function Composition
- Partial Application
- Passing arguments by reference or value
- Call and apply
- Function Arguments arguments object rest and spread parameters
- Using the Return Statement
- Get the name of a function object
- Recursive Function
- Functions as a variable
- Arrow functions
- Date
- Date comparison
- Scope
- AJAX
- Promises
- Introduction
- Promise chaining
- Waiting for multiple concurrent promises
- Reduce an array to chained promises
- Waiting for the first of multiple concurrent promises
- Promisifying functions with callbacks
- Error Handling
- Reconciling synchronous and asynchronous operations
- Delay function call
- Promisifying values
- Using ES2017 async / await
- forEach() with promises
- Performing cleanup with finally
- Asynchronous API request
- Regular Expression
- Error Handling
- Geolocation
- Cookies
- Intervals and timeouts
- Generators
- History of visited urls
- Strict mode
- Custom Elements
- JSON
- Binary Data
- Web Storage
- Fetch
- Modules
- Screen
- Inheritance
- Timestamps
- Destructuring assignment
- Web Worker
- Debugging
- Interactive interpreter variables
- Breakpoints
- Using setters and getters to find what changed a property
- Using the console
- Including a stack trace when logging - console.trace
- Automatically pausing execution
- Tabulating values - console.table
- Elements inspector
- Stepping through code
- Break when a function is called
- Notifications API
- WebSockets
- Web Cryptography API
- Async functions, async / await
- Constructor functions
- execCommand and contenteditable
- Performance Tips
- Avoid try/catch in performance-critical functions
- Limit DOM Updates
- Benchmarking your code - measuring execution time
- Cache (memoize) heavy-computing functions
- Initializing object properties with null
- Reuse objects rather than recreate
- Prefer local variables to globals attributes and indexed values
- Be consistent in use of Numbers
- Design patterns
- requestAnimationFrame
- Method chaining
- Global error handling in browsers
- File API, blobs and FileReaders
- Console
- Measuring time - console.time
- Formatting console output
- Printing to a browsers debugging console
- Including a stack trace when logging - console.trace
- Counting - console.count
- Tabulating values - console.table
- Debugging with assertions - console.assert
- Clearing the console - console.clear
- Displaying objects and XML interactively - console.dir console.dirxml
- Tail call optimization
- Detecting browser
- Enumerations
- Symbols
- Localization
- Selection API
- Callbacks
- Functional JavaScript
- Modals
- Data attributes
- Event Loop
- Events
- Data manipulation
- BOM Browser Object Model
- Unit Testing
- Linters for ensuring code quality
- Automatic Semicolon Insertion
- IndexedDB
- Anti-patterns
- Navigator Object
- Modularization techniques
- Proxy
- Same origin policy, cross-origin communication
- postMessage and MessageEvent
- WeakMap
- WeakSet
- Behaviroal Design Patterns
- Server-sent events
- Async iterators
- Namespacing
- Evaluating JavaScript
- Memory efficiency
- How to make iterator usable inside async callback function
- Context this
- Setters and getters
- Vibration API
- Fluent API
- Tilde
- Security issues
- Get and set CSS custom variables
- Contributors
Additional cached pages
These pages were cached but are no longer linked from the book contents.