Advertisement
vit134

Полифил bind упрощенный(Яндекс)

Nov 13th, 2018
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.     Полифил для bind (упрощенная версия)
  3. */
  4.  
  5. function bind(func, ctx) {
  6.   var boundArgs = [].slice.call(arguments, 2)
  7.   return function() {
  8.     var callArgs = boundArgs.concat([].slice.call(arguments))
  9.     return func.apply(ctx, callArgs)
  10.   }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement