JavaScript: The Definitive Guide, Sixth Editio javaScript权威指南(第6版) pdf 文字版-文字版, javascript电子书, 和javascript 有关的电子书:

8.3.2 Variable-Length Argument Lists: The Arguments Object

This special behavior of the Arguments object has been removed in the strict mode of ECMAScript 5. There are other strict-mode differences as well. In non-strict functions, arguments is just an identifier. In strict mode, it is effectively a reserved word. Strict-mode functions cannot use arguments as a parameter name or as a local variable name, and they cannot assign values to arguments. The callee and caller properties

In addition to its array elements, the Arguments object defines calleeand callerproperties. In ECMAScript 5 strict mode, these properties are guaranteed to raise a Type-Error if you try to read or write them. Outside of strict mode, however, the ECMAScript standard says that the callee property refers to the currently running function. calleris a nonstandard but commonly implemented property that refers to the function that called this one. The caller property gives access to the call stack, and the callee property is occasionally useful to allow unnamed functions to call themselves recursively:

8.3 Function Arguments and Parameters | 173

var factorial = function(x) { if (x <= 1) return 1; return x * arguments.callee(x-1);


友情链接It题库(| 版权归yishouce.com所有| 友链等可联系|粤ICP备16001685号-1