Recursive functions aren't infinite -- they can only keep going until they run out of stack space.
'Stack space' in this context is the memory that the program (ie the browser) allocates to remembering the function call chain, so that when your functions return it knows where to return to.
That memory space is limited, and when it runs out, the program will stop and throw an error (a Stack Overflow error).
If you are using a browser that has a developer tools window (ie virtually all of the major browsers), you should be able to see the error being displayed in the console window when it happens.
The exact number of times that the browser will run your loop will vary according to the browser and how much memory it has allocated to the stack. This is not something you have any direct control over - certainly not in a browser context anyway; in lower level programming such as a C/C++ program you would have the tools to define the stack size yourself, but in a browser these things are out of your control. That said, the browser should allocate sufficient memory to the stack that a program would never be likely to hit it unless it gets into an infinite loop.