Introduction
Chapter 1: An overview of standard built-in objects
Chapter 2: The Object object
- The
Objectobject - The
Objectobject’s methods and properties - Static methods on the
Objectobject Objectobject’s static “create” methodsObjectobject’s static “read” methodsObjectobject’s static “update” methodsObjectobject’s static “freeze” methodsObjectobject’s instance properties and methodsObjectobject’s instance propertiesObjectobject’s instance methodsObjectobject’s deprecated instance methodsObjectobject’s “checker ” instance methodsObjectobject’s “conversion” instance methods
Chapter 3: The Function object
- The
Functionobject Function.prototype.apply()- Whip up “Array.max” method with
Function.prototype.apply() Function.prototype.call()Function.prototype.bind()- Why bind a function?
- Use
bind()to cement the context ofthis - Use
bind()to partially apply a function - Use
bind()to pass context tosetTimeout() - Use
bind()for invocation shortcuts Function.prototype.toString()
Chapter 4: The Boolean object
- The
Booleanobject - The
Booleanconstructor and boolean primitives behave differently - Don’t convert a non-boolean using the constructor!
- Built-in
Booleanobject’s instance methods
Chapter 5: The Symbol object
- The
Symbolobject - There’s no “shorthand syntax” for the symbol primitive
Symbol()is a factory function- Why is the
Symbol()not a true constructor? - Using a symbol’s optional
descriptionargument - How to get a symbol’s description?
- Why Symbols in ES6?
- How to add a symbol to an object literal?
- Getting the value of a symbol key from an object
- Symbols are excluded from
for...inloops - Pseudo-hidden properties on objects are made possible by symbols
- Why symbols in ES6, again?
- Why symbols are not truly hidden?
- Symbols are skipped in JSON conversions
- Symbols can be used to avoid code collisions
- Symbols can be used to fix ENUM lists
- Use symbols as metadata storage
- The global symbol registry
- The difference between local and global symbols
- Well-known symbols
- Conclusion
Chapter 6: Built-in collection objects: Array
- The
Arrayobject - The
Array[@@species]accessor - The
Array.prototype[@@iterator]()instance method - The
Array.prototype[@@unscopables]instance property - The
Array.from()static method - The
Array.of()static method - The
Array.prototype.entries()instance method - The
Array.prototype.keys()instance method - The
Array.prototype.values()instance method - The
Array.prototype.findIndex()instance method - The
Array.prototype.lastIndexOf()instance method - The
Array.prototype.toLocaleString()instance method - The
Array.prototype.toString()instance method - The
Array.prototype.reduceRight()instance method
Chapter 7: Built-in collection objects: typed array objects
- Why typed arrays in JS?
- The immutability of
Blob - Extracting Blob slices
Chapter 8: Built-in collection objects: maps, sets, weak maps, weak sets, and arguments
- The
Mapobject - The
Setobject - The
WeakMapobject - The
WeakSetobject - The
argumentsarray-like object
Chapter 9: Error objects
- How to throw errors in JS?
- How to catch errors in JS gracefully?
- How to customize error messages in JS?
- What’s a stack trace?
- Strict mode and errors
- Browser sniffing and errors
- Errors and debugging
Chapter 10: Async-related and JSON-related objects
- An overview of built-in async-related objects, their properties, and methods
- The
Promise()constructor and thethen()instance method - Wrapping methods into promise objects
- Passing one more promise to the
resolveFn - The
Promise.all(iterable)static method - The
Promise.allSettled(iterable)static method - The
Promise.any(iterable)static method - The
Promise.race(iterable)static method - The
Promise.reject(reason)static method - The
Promise.resolve(value)static method - The
GeneratorFunction()andAsyncFunction() - Using
Generator.prototype.next() - Using
Generator.prototype.return() - Using
Generator.prototype.throw() - The
JSONobject JSON.parse(text[, reviver])JSON.stringify(value[, replacer[, space]])- The
ArrayBufferobject - The
SharedArrayBufferobject - The
Atomicsobject - The
DataViewobject
Chapter 11: String, number, date, and internationalization objects
Stringobject’s built-in methods and properties- “CREATE” string methods
- “READ location” string methods
- “READ inclusion” string methods
- “READ string comparison” string methods
- “UPDATE join and split” string methods
- “UPDATE spacing” string methods
- “UPDATE letter casing” string methods
- DELETE
- The
String.prototyperegex (pattern-matching) methods Numberobject’s built-in methods and propertiesDateobject’s built-in methods and propertiesIntlobject’s built-in methods and properties
Chapter 12: Regular expressions in JavaScript
- What is a regular expression in JavaScript?
- Regular expression literal
- Check if an object is of RegExp type
- RegExp constructor function
- RegExp modifiers (aka “pattern flags”)
String.prototype.split()withRegExpString.prototype.replace()withRegExpString.prototype.searchwithRegExpString.prototype.matchwithRegExpString.prototype.matchAll()andString.prototype.replaceAll()- Character classes (aka character sets)
- Combining character classes
- Negating character classes
- Using the pipe for optional matching
- Metacharacters
- Regular expressions quantifiers
- RegExp assertions
Chapter 13: Reflection and proxy objects (metaprogramming in JS)
- The
Reflectobject - The
Proxyobject - Specifing a proxy handler object
- An example of each trap method
- Back to the
Reflectobject - Proxy (trap) invariants
- Revocable proxies
- Building a proxy of a proxy
Chapter 14: Web assembly objects
Chapter 15: Revision
- 1. Build a new object and specify its prototype
- 2. Copy enumerable own properties from one object to another
- 3. Copy enumerable own properties from multiple objects into a single object
- 4. Convert an array of arrays into an object
- 5. Covert an object into an array of arrays
- 6. Log out an object’s members as key-value pairs
- 7. Inspect an objects own property descriptor(s)
- 8. An alternative way of counting the number of members in an array
- 9. Count the number of members in an associative array
- 10. Find the number of own properties that an object has
- 11. Get values out of an associative array
- 12. On an object, add a named property with property descriptor editability
- 13. On an object, add multiple named properties with property descriptor editability
- 14. Prevent an object’s shallow properties from being deleted or changed (freeze an object)
- 15. Freeze an array
- 16. Prevent exensions of object’s properties but allow for deletions
- 17. Prevent extensions and deletions of an object’s properties
- 18. Define getters and setters on an object’s property
- 19. Define getters and setters directly on an object literal
- 20. Inspect getters and setters on an object’s specific property
- 21. Check if an object has an own property and return a boolean of the result
- 22. Check if an object’s own property’s property is enumerable
- 23. Check if an object is a prototype of another object
- 24. Call a method to check the number of arguments a function expects
- 25. Log out all the arguments passed to a function call using the
argumentsarray-like object - 26. Apply an object as the
thisvalue of another object’s method - 27. Pass arguments to a function using the
apply()method without specifying the this argument - 28. Concatenate any number of arguments using the built-in “arguments” array-like variable
- 29. Sum up any number of arguments using the built-in “arguments” array-like variable
- 30. Concatenate the values of all the object’s properties, using another object’s
joinerfunction - 31. Borrow
Math.max()static method and apply it on an array of numbers to get the highest number - 32. Borrow
Math.min()static method and apply it on an array of numbers to get the lowest number - 33. Use apply to monkey patch (extend) a built-in object as a polyfill on an older browser
- 34. Borrow a method from one object to another object using
call()without arguments - 35. Borrow a method from one object to another object using
call()with arguments - 36. Use
apply()instead ofcall()in a given code snippet - 37. Prove that every function call is calling the
call()method in the background - 38. Chain constructors with the
call()method - 39. Fix the problem of keeping the context of
thisin a nested function - 40. Why bind a function?
- 41. Use
bind()to cement the context of this - 42. Use
bind()to partially apply a function - 43. Use
bind()to pass context tosetTimeout() - 44. Use
bind()to make invocation shortcut onArray.prototype.slice() - 45. Set a symbol as an object’s key
- 46. Add a symbol to an object literal
- 47. Prove that each symbol is unique
- 48. Check if a variable is of type
symbol - 49. Log out a symbol’s description
- 50. Why were symbols added to ES6?
- 51. Get the value of a symbol key from an object
- 52. Prove that symbols are excluded from
for..inloops - 53. Add a symbol to an object without storing the symbol in a variable beforehand
- 54. Prove that symbols are skipped in JSON conversion
- 55. What will happen if we try to reassign an existing symbol property in an object
- 56. Use a symbol to fix an ENUM list
- 57. Show how to use a symbol as a metadata storage
- 58. Show a use case for the
Array[@@species]accessor - 59. Reimplement a “regular” iterator with
Array.prototype[@@iterator]() - 60. Build an iterator that iterates over every even member of an array
- 61. Build an iterator that iterates over every odd member of an array
- 60. Convert a
Setto anArray - 61. Use a mapping function with
Array.from() - 62. Convert a
stringto anArraywithArray.of() - 63. Iterate over an array with
Array.prototype.entries - 64. Iterate over an array and break out of a loop based on a condition, using
Array.prototype.entries - 65. Split an array into a series of arrays using
Array.prototype.entries - 66. Split an array into a series of objects using
Array.prototype.entries - 67. Push array keys into a separate array using
Array.prototype.keys - 68. Print array values using
Array.prototype.values - 69. Find index of a matching member of array or return -1 with
Array.prototype.findIndex - 70. Search for a match from the end of array with
Array.prototype.lastIndexOf - 71. Localize a decimal number as price with
Array.prototype.toLocaleString - 72. Concatenate all args using
Array.prototype.reduce - 73. Concatenate all args using
Array.prototype.reduceRight - 74. How to throw errors in JS?
- 75. How to catch errors in JS gracefully?
- 76. How to customize error messages in JS?
- 77. Show that the
Promise()constructor must take a callback function - 78. Why no error is thrown when we call
then()on a promise, without passing any functions tothen() - 79. Build a promise that randomly fetches data from coindesk or throws an error, and catches it
- 80. Display a message at the end of a promise regardless of whether it succeeds or fails
- 81. Deal with potential errors by passing the second argument to the
then()call in a promise - 82. “Promisify” a method that does not usually return a promise object
- 83. Log out a sentence from inside a promise
- 84. Send a notification of a promise successfully fulfilled
- 85. Give an example of using
Promise.reject() - 86. Give an example of using
Promise.resolve() - 87. Return the
GeneratorFunction()constructor - 88. Return the
AsyncFunction()constructor - 89. Iterate values using
Generator.prototype.next() - 90. Iterate an array using
Generator.prototype.next() - 91. Send values to the generator
- 92. Show that the
Generator.prototype.return()finishes the generator
