js如何终止程序执行

135 阅读1分钟

本文已参与「新人创作礼」活动,一起开启掘金创作之路。 (一)在function里面
(1)return;
(2)return false;

(二)非function方法里面
alert("before error.");
throw SyntaxError();
alert("after error.");

 

(三)非function方法里面

 $("body").on("tap",".go-detail",function(e){undefined

 e.preventDefault();

 e.stopPropagation();

}