摘要: 严格模式 use strict,就是在代码的头部加上use strict function test(){ console.log(arguments.callee) console.log(123) } test() 把这段代码放到浏览器是不会报错的,但是,如果严格模式是会报错的,小伙伴们可以拿过 阅读全文
posted @ 2020-03-05 23:28 国服第一李师师 阅读(241) 评论(0) 推荐(0) 编辑
摘要: try{ [1,2,3].forEach((item)=>{ console.log(item) if(item == 1){ throw new Error() } }) }catch(e){ console.log(111) } 注意原始的for循环里面不能写return,如果想要跳出for循环 阅读全文
posted @ 2020-03-05 14:33 国服第一李师师 阅读(150) 评论(0) 推荐(0) 编辑