Possible Duplicate:
Firefox setTimeout(func, ms) sending default parameters to callback
I have been wondering this for a long time. When I type in the following line in FF, then I get:
var timer = setTimeout(function () {console.log(arguments)}, 500);
arguments
outputs an array with a random number开发者_JAVA技巧 in it, and this number is different from the value of the timer
. When I try on Chrome, the arguments
is an empty array.
Anyone has noticed this?
From https://developer.mozilla.org/en/window.setTimeout:
Gecko passes an extra parameter to the callback routine, indicating the "lateness" of the timeout in milliseconds.
精彩评论