您的位置:首页 > 其它

setInterval和setTimeout函数传参问题

2016-04-07 15:42 148 查看
function hello(){
console.log("你好");
}
var timer=setInterval(hello,1000);//1秒执行一次
/************************************************/
function hello(name){
console.log("你好"+name);
}
var timer = setInterval("hello('李明')",1000);//当调用的函数带有参数时,要加引号,setTimeout与setInterval在此问题上相同



                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: