Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional args missed #7

Open
martinborthiry opened this issue May 21, 2011 · 1 comment
Open

Additional args missed #7

martinborthiry opened this issue May 21, 2011 · 1 comment

Comments

@martinborthiry
Copy link

Nice tool, but:

Don't forget that the function in setTimeout and setInterval can recive aditional arguments.

Example:
var additionalVar1 = 11, additionalVar2 = 22;
setTimeout( function( a, b){ .... }, 1000, additionalVar1, additionalVar2);

// inside function "a" and "b" will be 11 and 22.

Is not common, but in some cases it is very usefull.
best regards

@avk
Copy link
Owner

avk commented May 26, 2011

Neat find, have never seen that syntax.

I didn't see the extra arguments described on W3schools but only at MDC. The latter says "Note that passing additional parameters to the function in the first syntax does not work in Internet Explorer."

Since it's not cross-browser, I'll keep this issue open but hold off on a fix unless more folks need it.

lin04com referenced this issue in lin04com/Timer.js Aug 9, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants