I was just looking at JavaScript Timing Events, and there it says that "The second parameter indicates how many milliseconds from now you want to execute the first parameter."
Now, I know that in JavaScript, both floating point and integers are of type Number
, and so syntactically I can enter a floating point value, e.g. 'setTimeout("javascript statement",4.5);
' - however, will JavaScript even attempt to create a delay of 4.5 milliseconds there; or will it just automatically truncate to integer and go on?
Thanks in advance for any answers,
Cheers!
This is almost certainly browser-dependent (I haven't checked it's not part of the language spec), but typically this value is stored in a 32-bit signed int, so would only accept integer values between 0
and 2^31 - 1
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With