Mr.Lucifer

Results 63 comments of Mr.Lucifer

大神,求助 全局 设置 git config 和 新建一个 .gitattriubutes 那个优先级高 @cssmagic

let const class 不会挂到全局作用域,而是在 script 作用域 let const 不可以重复声明 https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Statements/let

var 存在变量提升 可以重复赋值 不存在块级作用域 let 存在 TDZ,不存在变量提升,get 变量前必须声明 不可以重复声明 存在于块级作用域 const 存在 TDZ,不存在变量提升,get 变量前必须声明初始化 不可以重复声明 不可以重复赋值 (但对于引用对象的属性还是可以修改) 存在于块级作用域

1. 防抖 ```jsx function debounce(fn, delay) { let timer = null; return function(...args) { const ctx = this; if (timer) { clearTimeout(timer); } else { timer = setTimeout(()=>{ fn.bind(ctx, ...args);...

'b' 同名key 被后面的赋值覆盖 'c' Symbol 生成的值是唯一的,即可 key是一样的 ,不相等 (Symbol('123')===Symbol('123') // false) 'b' 对象的key 只可以是 string 或 Symbol 类型,其他类型会转换为 string ,即调用 toString (({key:'123'}).toString()===({key:123}).toString() // true)

js 的数组实现是基于对象 实现的 即 hash 的 key-value 形式,所以对于获取 任何一个 索引 的 时间复杂度都是 O(1)

使用babel 1. es6 代码字符串解析生成 AST 2. 按照es5 的规则 转换 生成符合es5规范的 AST 3. 将 AST 转换为代码字符串

https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Functions/Arrow_functions 1. 没有自己的this ,this 指向的是最近作用域内的对象 2. 没有 prototype,不可以进行 new 操作,没有 super,new.taret 3. 没有 arguments 对象,但是可以使用 es6 rest 操作符 获取 所有参数 4. 可以简写 ,如果返回值只有一句,可以省去 '{} ' 括号 5. 不可以在 yied 中使用...