A deep dive into JavaScript Prototypes & Polyfills — hand-crafted from scratch.
myPolyfills is a focused JavaScript repository dedicated to understanding how core JS built-in methods work under the hood — by implementing them manually using prototypes and polyfills.
Whether you're preparing for interviews, strengthening your JavaScript fundamentals, or just curious about how map, reduce, or flat actually work — this repo has you covered.
"The best way to understand a javascript is to code yourself."
| Technology | Purpose |
|---|---|
| JavaScript (ES6+) | Core language for all polyfill implementations |
| Prototypal Inheritance | Extending native objects via Array.prototype, String.prototype, etc. |
| Node.js | Runtime environment for executing and testing files locally |
✅ No frameworks. No libraries. No build tools. Just pure JavaScript.
Custom polyfills and prototype extensions for n-level nested arrays of numbers.
| Polyfill | Description |
|---|---|
| nlevelFlatten | Recursively flattens an array of any nesting depth |
| mean | Flattens an array and calculates arithmetic mean to 6 decimal places |
| median | Flattens an array and calculates median value to 6 decimal places |
| mode | Flattens an array and determines the mode or most frequently occurring value(s) |
- Node.js installed on your machine, or
- Any modern browser's Developer Console
Alternatively, paste any file's content directly into your browser DevTools console and experiment in real time.
-
flatpolyfill : Flatten n-level nested array of numbers -
flatpolyfill and calculate values from an array of numbers : Flatten n-level nested array of numbersStatistical methods: Mean, Median, Mode -
forEachpolyfill -
reducepolyfill -
mappolyfill -
filterpolyfill -
find&findIndexpolyfills -
every&somepolyfills -
bind,call,applypolyfills -
Promisepolyfill
- Deepens your understanding of how native JS methods really work
- Builds stronger intuition around prototypal inheritance
- Sharpens your algorithm and problem-solving skills
- Great preparation for technical interviews 🎯
- Helps you write more predictable, performant code
This repo is actively maintained and expanding.
⭐ Star the repo to get notified when new polyfills drop — keep visiting for updates!
Abhishek — @Abhishek278604
Distributed under the MIT License. See LICENSE for more information.
Special Credits and Thanks To :
- Hitesh Chaudhary Sir - @hiteshchoudhary
- Piyush Sir - @piyushgarg-dev,
- Chaicode Team - @chaicodehq