If a function calls itself recursively then the JavaScript engine has to create a new 'stack' (i.e. allocate a chunk of memory) to keep track of the function's arguments.
Let's look at an example of this happening:
function sum(x, y) {
if (y > 0) {
return sum(x + 1, y - 1);