© 2026 LinearBytes Inc.
Search posts, tags, users, and pages
Atul Sharma
Full Stack Developer | Cloud Native Applications
How can we implement bind using call & apply?
Peter Scheler
JS enthusiast
This shouldn't be necessary because Function.prototype.bind() is very common.
If you really need it (for ES3 for example) there is a polyfill on the MDN page.
Yes, bind is very common. Just looking it for interview purpose.
Atul Sharma Ok.
My modern quick solution would be:
Object.defineProperty(Function.prototype, 'bind', { value(self, ...bindArgs) { return (...args) => this.call(self, ...bindArgs, ...args) } })
Peter Scheler
JS enthusiast
This shouldn't be necessary because Function.prototype.bind() is very common.
If you really need it (for ES3 for example) there is a polyfill on the MDN page.