In JavaScript, functions can be nested.
For example:
1 2 3 4 5 6 7 |
|
In JavaScript, a function is bound to an object, and the function called by the object is called a method, which is easy to be confused with C#.
1. Function attributes
In the function body, you can get the number of actual parameters passed into the function through arguments.length.
1 2 3 4 5 |
|
2. Bind the function to the object
1 2 3 4 5 6 7 |
|