I have a dojo define function like this one
define([
// some param
]),function(foo, bar, baz, fooz, ...){
return{
// some custom code
}
}
I would like to access dynamically to my function args(foo, bar, …)
i know i could wrap it into var
foo : foo
and access it with
this[objectToCall].methodToRun();
in this example the calling should be
this.run('foo');
function run(objectToCall){ // foo
this[objectToCall].methodToRun(); // refer to foo
}
Is there a way to achieve this without wrapping it into a var ?
thx in advance
EDIT :
little step further
i could use arguments keyword.
function(foo, bar, baz, fooz, ...){
var functionArguments = arguments;
return{
// some custom code
}
}
but i can’t access the foo object with functionArguments['foo'];
found the solution :
and added a name param in my object’s definition