polyfill for bind in javascript code example
Example: polyfill for bind
Function.prototype.myBind = function (...args) {
const that = this
const params = args.slice(1)
return function (...args2) {
that.apply(args[0], [...params, ...args2])
}
}