Cómo terminar un programa en JS
process.exit(1)
Smiling Sable
process.exit(1)
process.exit(1)
You can just use return
Example:
function myFunction() {
console.log("I QUIT!")
return;
}