JS使用中碰到的一些问题

settimeout:

1.setTimeout(function () {//这个则会在1秒后进行弹出1
alert(1);
}, 1000);

2.setTimeout(alert(1), 1000);//这个在js中不会等待1秒,就会直接出来弹出1
setTimeout(function () {
alert(1);
}, 1000);
 
setTimeout(alert(1), 1000);
原文地址:https://www.cnblogs.com/danlis/p/6128568.html