Keep it simple. You can use a named function instead of an anonymous function; call it and set an interval for it.
function doSomething() {
console.log("tick");
}
doSomething();
setInterval(doSomething, 9000);
Create a scope if necessary:
(function() {
function doSomething() {
console.log("tick");
}
doSomething();
setInterval(doSomething, 9000);
})();
Finally, the following works without creating or affecting x
:
setInterval(function x() {
console.log("tick");
return x;
}(), 9000);