随笔分类 -  前端

摘要:GO和AO 变量的预编译 实例1 console.log(a); var a=1; console.log(a); 实际编译过程: 将a存入预编译对象中,赋值为undefined; 真正的赋值语句当程序运行到时才会执行。 实例1等价: var a=undefined; console.log(a); 阅读全文
posted @ 2021-09-18 13:55 CCCC_03 阅读(117) 评论(0) 推荐(0)
摘要:相等操作符 相等 和 不相等 经过强转后比较值 '123'==123 //true 全等和不全等 全等 当数据类型和值都相等时成立 '123' '123' //true '123' 123// false 不全等 当数据类型或值不同是 都成立 '123'!==123 //true '123'!==' 阅读全文
posted @ 2021-09-16 18:53 CCCC_03 阅读(40) 评论(0) 推荐(0)
摘要:undefined和null undefined的情景: 声明变量为赋值 var name; console.og(name); //undefined 访问对象上不存在的属性 var obj={} console.log(obj.age);//undefined 函数调用时 参数不完整 funct 阅读全文
posted @ 2021-09-16 14:39 CCCC_03 阅读(68) 评论(0) 推荐(0)
摘要:关于document.write() document.write()页面覆盖问题 如果在文档已完成加载后执行 document.write,整个 HTML 页面将被覆盖。 <body> <h1> hello </h1> <button onclick="document.write('hello1 阅读全文
posted @ 2021-09-12 22:47 CCCC_03 阅读(42) 评论(0) 推荐(0)