How do I stop function started by setTimeout call

Only if you leave out the ‘use strict’ command. With that command included any variable you forget to declare will generate a syntax error.