Maximum call stack

I’d like to know if the freecodecamp engine has the same call stack as the browser engine. I’d also appreciate additional insight on the topic(call stacks… that is) as it is one I don’t understand very well.

Do you mean the whole Maximum call stack size exceeded thing? That is usually a sign you have written an infinite loop, and to answer your question, no. FCC has a much stricter stack policy, from what we’ve been hearing.

An example of this is, in one of the challenges, you sum all primes below a given n. If n=20, it runs fine. If n=2000000, on the other hand, depending on the algorithm it will run REALLY slowly in your browser, but it will simply error out in the FCC “interpreter”.

FCC doesn’t really have an engine per se, it is simply built on top of the engine your browser is using. But, in order to prevent a lesson from completely locking, they have added filters for potential infinite loops that are much stricter than those used within most browser’s JS engines.

Well mine was with the smallest common multiple challenge. I noticed the last two tests do not pass, however it works just fine on chrome’s console. I just assumed it was a stack overflow(correct me if i’m wrong ) error.

Thanks for your input learnt something today.

Much obliged.

1 Like