摘要: 什么是异步? <script> //异步 console.log(1); setTimeout(function(){ alert(2); },1000); console.log(3); //同步,存在阻塞 console.log(1); alert(2);//不点击确定,不会打印3 consol 阅读全文
posted @ 2020-04-19 22:46 陈莺莺呀 阅读(302) 评论(0) 推荐(1) 编辑
摘要: 作用域和闭包-执行上下文: 变量提升(写代码时千万不要先使用再定义) <script> console.log(a);//undefined var a=10; fn('cyy',18); function fn(name,age){ age=20; console.log(name,age);// 阅读全文
posted @ 2020-04-19 21:25 陈莺莺呀 阅读(1190) 评论(0) 推荐(0) 编辑