JavaScript
15 tips tagged with #javascript.
- Insert multiple HTML elements at once with DocumentFragment
- Style console log outputs in JavaScript
- Edit any website in design mode
- Function parameters can have default values based on other parameters
- setTimeout accepts arguments for the function
- Create an array with the map function of Array.from
- Alpine.js accepts a custom prefix for directives
- How to use Array.map() with objects
- Keep the separators when splitting a string in JavaScript
- How to get the event target inside Shadow DOM
- Get IANA timezone of user
- Query selectors are applied to the whole document, unless you use :scope
- Get translated display names with Intl.DisplayNames
- Backreference in RegEx allows matching the same text as a previous capturing group
- XState Actors are observables