Skip to content
JS
Recipes

JavaScript recipes

84 tasks with working code, grouped by what you are working with.

Filter, sort, group, dedupe, chunk and transform arrays.

Read, merge, copy and iterate over object properties.

Search, replace, trim, pad and convert strings.

Round, format, parse and validate numbers.

Add, subtract, compare and format dates and timestamps.

Select, create, move and update elements on the page.

Listen for, dispatch and simulate browser events.

Work with Map and Set collections.

Parse URLs, query strings and domains.

Read, parse and download files.

Viewport, clipboard, storage and other browser APIs.

Operators, conditionals, scope and language basics.

import, export, ESM and CommonJS.

Print and inspect values while debugging.

Classic algorithms implemented in JavaScript.

Server-side scripts, processes and the file system.