We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
With a large array flatten() fails with a stack overflow error.
flatten()
A (much bigger) implementation that works:
function flatten(array: any[]) { const result: any[] = []; for (const element of array) { if (Array.isArray(element)) { for (const inner of element) { result.push(inner); } } else { result.push(element); } } return result; }
The text was updated successfully, but these errors were encountered:
5c215da
No branches or pull requests
With a large array
flatten()
fails with a stack overflow error.A (much bigger) implementation that works:
The text was updated successfully, but these errors were encountered: