This repository contains implementations of various core and advanced JavaScript concepts.
Description: Delays a function’s execution until a set amount of time has passed since its last call.
Description: Ensures a function runs at most once within a fixed time interval, regardless of how many times it’s triggered.
Description: A polyfill is a technique that implements a feature in older environments or browsers that do not natively support it.
● Array.prototype.map()
● Array.prototype.filter()
Description: A technique that defers image loading until they are about to appear in the viewport. By leveraging the Intersection Observer API, it improves page performance, reduces initial load time, and optimizes bandwidth usage.
Description: Dynamically loading cards as you scroll, using the Intersection Observer API. The implementation includes performance optimizations such as DocumentFragment and controlled DOM updates for smooth rendering.
- Lazy-loads cards when the loader comes into view
- Uses
IntersectionObserverto detect scrolling - Wraps card creation in a
Promiseto handle unobserving/reobserving loader - Optimized DOM updates using
DocumentFragmentand batched appends
Description: Handles asynchronous operations in JavaScript, allowing sequential or parallel execution with proper success/error handling.
Features:
- Represents the eventual completion or failure of an async operation
- Promise Chaining: Execute tasks sequentially using
.then() - Promise.all(): Run multiple promises in parallel; fails if any reject
- Promise.allSettled(): Wait for all promises to settle regardless of outcome
- Promise.race(): Resolves/rejects with the first settled promise
- Promise.any(): Resolves with the first fulfilled promise; rejects with
AggregateErrorif all fail
git clone https://github.com/vmanidev/javascript-concepts.git