You might want to use Workers or something that runs your code in a different process safely, because if I'm reading your code correctly, if you write something like while (1){} in the JS editor, you freeze the entire app.
.... it still matters. If you're writing while(value) { and said value starts as a truthy and you were planning to set it to falsy inside that while, you'll never be able to do that because the editor will freeze before that. You write infinite loops all the time, you just write the logic to stop them after, if an editor renders as soon as you write, it will freeze. It should ideally show an error as editors like CodeSandbox, CodePen or StackBlitz do.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
You might want to use Workers or something that runs your code in a different process safely, because if I'm reading your code correctly, if you write something like
while (1){}in the JS editor, you freeze the entire app.I'll learn about it soon and improve myself. Thank you so much for your advice
It shouldn't matter because the code is sent to the client and is not evalled. So the client would freeze itself if it enters while (1) {}
.... it still matters. If you're writing
while(value) {and said value starts as a truthy and you were planning to set it to falsy inside that while, you'll never be able to do that because the editor will freeze before that. You write infinite loops all the time, you just write the logic to stop them after, if an editor renders as soon as you write, it will freeze. It should ideally show an error as editors like CodeSandbox, CodePen or StackBlitz do.