I am new to JavaScript. Just like in Java, we have a method System.exit(), which stops current executing thread. I want to achive something similar in JavaScript. I have a flow of control, where I want to stop the execution if a particular condition is met.
I tried using exit()/ exit(0)/ exit(1) but it didn't help.
Whats the right way of doing it in JavaScript?