The timeout syntax is:
The return value is an identifier for this timer event. So if you want to cancel it you need to use this identifier.
A very simple example is the code below. Here we will display a simple alert message. We use 2 buttons here. The click on the first one will display an alert without timeout, however the click on the second button displays a message using a 3 seconds timeout.
As you can see here we didn’t used the return value of the timeout function. It is because in this case we only want to make a certain task only once. In case of displaying current time we need to use a recursive call.