JavaScript Tips of the Day
This is an outline of a series of JavaScript tips that were posted on the kirupa.com forums. They consist of JavaScript features, how-tos, and other miscellaneous JavaScript or JavaScript-related knowledge.
The following list is a sequential list in the order the the tips were posted. The original JavaScript Tips of the Day thread also contains a list of these tips separated by category.
Tips
- Optional Chaining
- Nullish Coalescing Operator
- The Official JavaScript Reference: MDN
- Detecting Dark Mode
- Default Function Parameters
- Thenable Objects
- Reduce Code with Destructuring
- JavaScript (ECMAScript) Versioning
- Variables in Strings with Template Literals
- Event Attributes also Define Callback Functions
- Symbols for Safe Property Names
- Internal Slots
- Reduce Code with Object Shorthand Syntax
- Declarations let, const and class Can’t be Redeclared
- Missing Semicolon ASI Gotchas
- typeof null === “object”
- Overriding Constructor Returns
- JavaScript with Types: TypeScript
- Symbol.toStringTag
- addEventListener Options
- Hoisting
- Spreading Values
- Generators for Iterables
- JavaScript Outside the Browser: Node
- The Return of ASI
- super() Defines this
- fetch is the new XMLHttpRequest
- Is it an Array?
- Create Iterable Objects
- ECMAScript New Feature Proposals
- Exotic Objects
- setTimeout Callback Arguments
- Numeric Literal Formats
- Scrolling an Element into View
- Generating Ranges
- Async Functions and await
- Expandable Logs With console.dir
- Format Time Strings with Padding
- with Statements
- New Functions With new
- Array-likes
- Accessor Properties (Getter/Setter)
- Not All Functions Are Constructors
- Attribute Event Scopes
- super in Object Literals
- Property Descriptors
- Finding Elements in the DOM
- Chaining
- Default Parameters with Destructuring
- Define vs. Assign
- Live DOM Lists
- Constructors Don’t Need Parens
- What Uses enumerable?
- The Iterator Protocol
- Easily Toggle HTML Classes
- Using Destructuring to Swap Values
- Interacting With Generators
- Detect Errors Early With Linting
- Setting HTML Element Styles
- The Deal With Prototypes
- Stylish Logs
- Symbol.species
- Static Members Are Inherited
- Entering Fullscreen
- Proxy Objects
- Yield Many With yield*
- Variable Shadowing
- When the constructor Property Matters
- The Window Proxy
- Flattening Arrays
- A Custom Self-rejecting Promise
- globalThis
- Awaiting Non-promises
- Filter and Map With flatMap
- Computed Properties
- Global Object vs. Global Declarations
- Generator Prototypes
- HTML ids Are Global
- Mixins
- JSFuck
- Symbol.hasInstance
- Preventing Extensions in Objects
- Animations With requestAnimationFrame
- What is a NaN?
- proto in Object Literals
- Promises Block Rendering
- Sealing Objects
- MutationObserver
- Negative Zero
- Parameters are Reference Variables
- Freezing Objects
- Time-based requestAnimationFrame
- Constructor Internals
- Object Serialization With JSON
- Kinds of Comparisons
- Console $ Utilities
- Canvas for Bitmaps
- The Underscore Convention
- Labels
- Using Generators to Animate
- Copying Accessor Properties
- String Conversions in Depth
- Custom Serialization With toJSON
- A Function's Home Object
- Trailing Commas
- JSON Reviver Function
- Mixing class and function Constructors
- The debugger Statement
- Function Name Bindings
- Closure Scopes Limit Closure Variables
- Prototypes as Instance of Type
- Object.keys vs Array.keys
- Undefined vs. Null vs. Nullish
- Default Parameter Scope
- The Long Arrow Operator
- Async Generators
- ES2021 Preview