What does setTimeout return?

It’s a handle (a unique identifier). When you create a timeout, the JavaScript runtime associates a handle with the timeout you created, and it can identify that timeout by the handle setTimeout() returns. When you run clearTimeout(), it will know what timeout you’re talking about by looking at the unique handle you pass in.

Leave a Comment