constbite1=arr=>{const[head,...tail]=arrif(tail.length===0)return"⚰"returnbite1(tail)}console.log(bite1(newArray(2000)))// SuccessconstbiteV=(...args)=>{const[head,...tail]=argsif(tail.length===0)return"⚰"returnbiteV(...tail)}console.log(biteV(...newArray(600)))// DIES
In both cases we are iterating immutably and using lots of memory, but the second runs out of stack space while the first doesn't. (And mere 600 is far from a ridiculous number!)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
This is problematic because it goes on the stack.
In both cases we are iterating immutably and using lots of memory, but the second runs out of stack space while the first doesn't. (And mere
600
is far from a ridiculous number!)