How to loop through all params without knowing their names

I have a few functions that accept several parameters.

public function somefunc(param1:String, param2:String, param3:String):void{

}

Is there a way to loop through all the params (without knowing how many or their names) and put them in some kind of an array with their names, so I'd get an associative array

[
param1: "value 1"
param2: "value 2"
param3: "value 3"
]

Answers


The object arguments stores a function's arguments and you can use the length property to get the number of arguments. However it does not provide the names of the arguments, i.e. it won't provide names param1, param2 etc. It will only provide the values of them.


Need Your Help

Comparing two files using commons or Javascript

java javascript apache-commons

I need to check if any of the 4 uploaded files are same, this check might be on the JSP or Java-Servlet side.

ListView in background receives input (Fragment API)

android tabs focus fragment framelayout

My app is based on a tabbed layout where each tab is assignes a FragmentActivity.