1k views
Detect number of parameters of a Function
functionName.length tells you how many parameters a function has. This is an undocumented feature so use it carefully.
For instance:
ActionScript 3
- // ...
- if (callback.length == 0)
- callback();
- else if (callback.length == 1)
- callback(someData);
Submitted by miguelSantirso about 1 year ago — last modified less than a minute ago