DEV Community

Cover image for This code Crashes chrome tab #1
Mafee7
Mafee7

Posted on • Edited on

3 2

This code Crashes chrome tab #1

Yes this is NOT a while() loop crash.
Sorry, I was busy making apps - couldn't post :(

This is part 1, the second one is being investigated, & ACTUALLY Crashes the browser window!

Error: Out of memory.

Result of A list which has 10 million items in it!

You try this code in jsfiddle/tab.

code:

var list = [];

setInterval(() => {
    list.push("crash")

    list.forEach(item => {
        list.push(item);
    });
});
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay