JS Exit() | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 6

JS Exit()

What is the JS equivalent of python's sys.exit(0)? Is there one? Thanks!

26th Aug 2018, 1:31 PM
Paul Grasser
Paul Grasser - avatar
1 Resposta
+ 4
as I understand it sys.exit(0) will kill the current python process running the application, and as such I will assume youā€™re writing a NodeJS-esc appliation that will have a process on the machine. If so then node has a built in object called ā€˜processā€™ which has a method called exit. process.exit(); would kill the current node process. If youā€™re not writing node, then maybe you could explain what you are trying to do and I can possibly help further.
27th Aug 2018, 2:36 AM
Gabriel Jon Peery
Gabriel Jon Peery - avatar