how to crash browser in javascript

It is not recommended nor ethical to intentionally crash a browser using JavaScript. However, for educational purposes, this can be achieved by creating an infinite loop that consumes system resources and eventually crashes the browser. Here's an example:

index.tsx
while(true){}
14 chars
2 lines

When executed, this code will infinitely loop and cause the browser to hang. To stop the code from executing, you can close the tab or window, or force quit the browser altogether. Again, it is strongly advised against intentionally crashing a browser as it could lead to malicious activity and vulnerability exploits.

gistlibby LogSnag