Too much recursion – Firefox

I was getting “too much recursion” in firefox console by using this simple string

while($row)
{
string_a  = string_a + $row['name'];
}

Found out that in JavaScript you can not concat string forever eventually it will give you “too much recursion”.

After experimenting with  it I found that the “too much recursion” is thrown at 180th loop. So if you have 179 result, it should not through error.

I also tested the same code in Safari on Mac and the behavior is exactly the same. It throws error at 180 recursion, however the error it throws is different. In case of Safari the following error is thrown

RangeError: Maximum call stack size exceeded.

Hope it helps somebody!

Advertisements
This entry was posted in Uncategorized and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s