js 存在意义 --web里,只有js跨 平台和浏览器 处理页面,与用户交互
1) 严格区分大小写
2)等号比较

3) 浮点数比较以及空

4)var 声明变量只能用一次, var a=1 ; a=123 即强调声明 ; 没有强制要求用var ,若不用 就变成全局变量 ,会引发冲突,要利用以下模式

多行字符串 `............` 利用此符号



判断某属性是否存在 in ----但是继承的属性有也会成立,要但判断里面有无,需要使用hasOwnProperty()

map和set
map 键-值 之前字典不支持数字类型作为键,所以需要这种新数据类型。
类似var a=new Map([[1,2],[2,3]])
for in|of in大于of范围 in包含属性 of类似列表


this 指针:
必须要以obj.xxx()调用,不然会返回错的信息 ;strict模式下,函数默认this默认是undfined, 让问题及早暴露出来



不能在函数体外定义 指针 类似

修复办法,在函数内赋值

apply制定参数和对象


依赖于对 对象 的控制,可以保证正确执行 正常函数对象用null
网友评论