Recipes
The module pages tell you what each function does.
These pages start from a problem instead — the kind you arrive at from a search
engine — and show the whole solution, including the parts that are not
js-common at all.
Every snippet is copy-pasteable as written.
| Recipe | Modules |
|---|---|
| Format a date for a user's locale | date, datetime, i18n |
| Debounce a search input | functions, abortController, try, errors |
| Safely parse untrusted JSON | json, validation |
| Generate a slug and keep it unique | strings, arrays, random |
| Retry an async operation with exponential backoff | promises, numbers, random, try |
Missing one you needed? Open an issue — the gaps people hit are the best guide to what to write next.