how to stop a program in javascript code example Example 1: how to terminate a program in js process.exit(1) Example 2: how to end a javascript program { ------- }