[javascript] How to terminate the script in JavaScript?