When learning arguments objects, a piece of code encountered is not too good to understand. Original address Chinese (http://www.jb51.net/article/25048.htm), English (http://www.sitepoint.com/arguments-a-javascript-oddity/)
To understand correctly, you need to grasp the place of the red mark.
1,function.prototype.apply () Usage
2. Need to understand MajorTom here points to anonymous function functions () {return func.apply (null, Args.concat ( Array.prototype.slice.call (arguments)));}
<! DOCTYPE html>functionFormat (string) {varargs =arguments; varPattern =NewREGEXP ("% ([1-" + Arguments.length + "])", "G"); returnString (String). replace (pattern,function(match, index) {returnArgs[index]; }); } functionMakefunc () {varargs =Array.prototype.slice.call (arguments); varFunc =Args.shift (); return function () { return func.apply (Null , Args.concat (Array.prototype.slice.call (arguments))); }; } varMajorTom= Makefunc (Format, "This was Major Tom to ground control. I ' m%1. "); Console.log (MajorTom ("Stepping through the door");//MajorTom is a reference to an anonymous function "</script>Arguments object, apply (), anonymous function