I need to pass arguments onto a callback function as real arguments. How do I do that? callback requires a variable number of arguments.
Example function like this:
var func = function (callback) {
doSomething(function () {
// the goal is to pass on the arguments object to the callback function as real arguments
callback(arguments)
});
}
Thanks in advance.
It might be a similar question to this: Is it possible to send a variable number of arguments to a JavaScript function?
But I didn't understand that question nor the answers.
Edit: If possible, I would like to not pollute global.