Firefox setTimeout(func, ms) sending default parameters to callback

前端 未结 2 1371
别那么骄傲
别那么骄傲 2021-01-21 23:06

I am unable to find out more about this default parameter that I ran across and was hoping that someone could point out an explanation.

In Firefox (3.6 in this case) if

2条回答
  •  说谎
    说谎 (楼主)
    2021-01-21 23:26

    You're correct that it's the offset. It'll usually be zero (meaning it was called when it should have been), but if the JS engine is backed up, it'll be higher, or it can even be negative.

    reference: https://developer.mozilla.org/en/DOM/window.setTimeout

    (see the part in yellow)

提交回复
热议问题