diff --git a/lib/annyang-core.js b/lib/annyang-core.js index 82c8b23..58605a9 100644 --- a/lib/annyang-core.js +++ b/lib/annyang-core.js @@ -30,8 +30,7 @@ const commandToRegExp = function (command) { }; // This method receives an array of callbacks to iterate over, and invokes each of them -const invokeCallbacks = callbacks => { - let args = Array.prototype.slice.call(arguments, 1); +const invokeCallbacks = (callbacks, ...args) => { callbacks.forEach(callback => callback.callback.apply(callback.context, args) );