So I have a function with quite a few parameters, for example
function myFunction(height, width, name, surname, time){
...
}
The trouble is I want to use this function to send different sets of parameters.
So sometimes it would be...
function myFunction(height, width, depth, name, surname, time){
...
}
The function is used for many tasks and I don't want a long list of parameters in the function coupled with lots of spaces in the values list when the function is called.
I need something more dynamic, ideally an associative array would be passed to the function and variables created from that.
ideally an associative array would be passed to the functiongive that a try. If you can't get it to work post your code. If you are using jquery you can use theextendfunction to merge the passed in array with a default array.