I read recently that setTimeout()
's timeout limit is 2147483647
.
When I set the timeout to 2147483648
the program changes it to 1
but doesn't do when the timeout is set to 52147483648
.
setTimeout(() => console.log(2147483648), 2147483648) // will fire in 1ms
setTimeout(() => console.log(52147483648), 52147483648) // will fire in a long time
What is happening here?