Home > Web Front-end > JS Tutorial > A brief analysis of the difference between arguments and arguments.callee in Javascript_Basic knowledge

A brief analysis of the difference between arguments and arguments.callee in Javascript_Basic knowledge

WBOY
Release: 2016-05-16 16:02:32
Original
1311 people have browsed it

Let’s understand the specific difference between arguments and arguments.callee through an example:

The code is as follows:

Copy code The code is as follows:





Calling method:


Copy code

The result after running is:



Copy code wrong number of arguments: expected: 3; actually passed2
NaN



My understanding:
arguments is the calling object, which is the object that calls this method arguments.callee is the current object, which actually returns the currently executed function object

Through this example, we can see that

arguments actually refers to the function "f(1,2)"

argument.callee actually refers to "function f(x,y,z){}"

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template