I want to access my routine parameters like in a bash script, by using the dollar prefix and the parameter number ($1 = first parameter, $2 = second parameter), my function signature must be empty.
function foo (/* Empty */) {
return $1 + $2 + $3;
}
foo(2, 2, 4); // => 8
How can i do this? I tried using the apply method without success.
foo.apply(null, { $1: 2, $2: 2, $3: 4 });