1

Here is _.extend from underscore.

  // Extend a given object with all the properties in passed-in object(s).
  _.extend = function(obj) {
    each(slice.call(arguments, 1), function(source) {
      if (source) {
        for (var prop in source) {
          obj[prop] = source[prop];
        }
      }
    });
    return obj;
  };

The function call expects a this value followed by a list of arguments.

If the only argument passed is '1', then slice will return an array omitting the first item.

However, how can arguments be used as a this value as defined my MDN.

MDN

call

slice

arguments

3

3 Answers 3

1

Using arguments as the this value applies the function to arguments. It would be like doing arguments.slice(1), except you can't because arguments is technically not an array.

1

The same thing it always references, the arguments passed to the containing function.

0
0

I believe "this" is implied. Sometimes you have to "force" a fake list to apply to some Array prototypes else it won't work.

I might be misunderstanding your questions, if so - I apologize.