$ show javascript-tutorial/en.javascript.info
This is the official repository for The Modern JavaScript Tutorial (javascript.info). It is primarily an educational resource containing structured articles, code examples, and interactive exercises covering JavaScript fundamentals, browser APIs, network, animations, and more. The codebase is not a software application but a collection of teaching materials. The code examples are well-crafted, demonstrate modern practices, and include patterns like throttling, debouncing, promise-based helpers, custom elements, and event delegation. While the examples are tightly coupled to the tutorial context, several utility functions (e.g., cookie helpers, animation timing functions) are self-contained and could be extracted for reuse. The repository follows a logical chapter hierarchy and includes solution views with test files. It is actively maintained with recent updates reflecting current JavaScript standards.
The LLM identified 4 files worth highlighting for reuse:
A small, self-contained utility providing getCookie, setCookie, and deleteCookie functions. It handles cookie parsing, setting with proper flags (path, domain, expires), and deletion. Could be extracted into any web project that needs simple cookie management.
Implements a throttle decorator that limits function invocation to at most once per specified delay. Uses a timer-based approach with proper handling of trailing calls. Clean, reusable pattern for rate-limiting user inputs or scroll handlers.
Implements a debounce decorator that delays function execution until after a specified wait period of inactivity. Demonstrates use of setTimeout and clearTimeout. Standard pattern for search input autocomplete and resize events.
A self-contained custom element that formats a Date object as a localized time string and updates every second. Uses `connectedCallback` and `attributeChangedCallback` lifecycle methods. A clean example of a reusable, stateful web component.