// Напишите полифилл на bind

**Ответ

Function.prototype.myBind = function (context, ...args) {
  return (...rest) => {
    return this.call(context, ...args.concat(rest));
  };
};
 
function log(...props) {
  console.log(this.name, this.age, ...props);
}
 
const obj = { name: "Vladilen", age: 28 };
 
log.myBind(obj, 1, 2)();

Назад