Named anonymous function inside setInterval