If you obtain a handle, either method can have its triggering ceased
the set time out has been given a function to call in 10 seconds but the very next line clears the timer because a handle was obtained that can then be used to clear the timer. The same procedure for setInterval is employed if you want some control over how many callbacks take place.
c = c + 1;
console.log(">>> c="+c); // output to the browsers console
That will call the someFunc() function 10 times before clearing the call back.