interval and killer are variables local to the functions they are declared in.
The var statement, outside the function, establishes the variable so that all functions can get to it. If the var is inside a function, the variable is only available inside that function. To learn more, go to W3Schools and look up 'javascript variable scope'.