Skip to main content

Harshal V. LADHE

JavaScript Polyfills and Fallbacks

Feature detection, polyfills such as `core-js` and hand-written fallbacks that let modern JavaScript features run in older browsers and runtimes.

Content tagged polyfills

  • Post:Backwards-Compatible JavaScript: Polyfills and Baseline

    Use new JavaScript without breaking older browsers.
    Write backwards-compatible JavaScript: feature detection, safe core-js polyfills, transpiling vs polyfilling, Baseline and browserslist queries.
    Published at:
    Categories:JavaScript
    Estimated reading time:15 min read
  • Snippet:Bytes to Hex and Back with Uint8Array.fromHex() and toHex()

    Convert bytes to hex and back without padStart loops.
    Encode bytes as hex with ES2026's Uint8Array toHex(), decode with fromHex() and setFromHex(), with SHA-256 digests, colours, error cases and a padStart fallback.
    Published at:
    Categories:JavaScript
    Estimated reading time:5 min read
  • Snippet:First N Matches from Any Iterable with filter() and take()

    Get the first N matches and stop reading.
    Return the first N matches from any iterable with Iterator.from(), filter() and take(), stopping as soon as it has enough, even on infinite sequences.
    Published at:
    Categories:JavaScript
    Estimated reading time:4 min read
  • Tutorial:Iterator Helpers: Lazy Pipelines over Any Iterator

    Map, filter and take over any iterator, lazily.
    Use ES2025 iterator helpers (map, filter, take, drop, flatMap, reduce, Iterator.from) to build lazy pipelines over generators, Sets, Maps and infinite sequences.
    Published at:
    Categories:JavaScript
    Estimated reading time:10 min read
  • Tutorial:JavaScript Iterator chunks(), windows(), includes() and join()

    Group, window, search and join any iterator natively.
    Use JavaScript's new iterator chunks(), windows(), includes() and join() for batching, moving averages and calendar rows, with edge cases and fallbacks.
    Published at:
    Categories:JavaScript
    Estimated reading time:13 min read