This is a problem that I know is simple, yet I'm stuck. If you could help me figure out what's missing in my code, I would appreciate it. I need to pass two tests 1) should execute function after specific wait time and 2) should have successfully passed function arguments in. The instructions are below as is my code. My issue here is that the code passes the first test but it doesn't pass the second one.
Instructions:
"Delays a function for the given number of milliseconds, and then calls it with the arguments supplied. The arguments for the original function are passed after the wait parameter. For example _.delay(someFunction, 500, 'a', 'b') will call someFunction('a', 'b') after 500ms"
My code:
_.delay = function(func, wait) {
return setTimeout(function(){
return func.call(this, arguments);
}, wait);
};