摘要: // es7 数组的拓展 // Array.prototype.includes() 返回布尔值 判断数组是否包含某个值 // const arr = ['es6', 'es7', 'es8'] // console.log(arr.includes('es7')) // console.log(a 阅读全文
posted @ 2021-03-10 16:39 贺可英 阅读(96) 评论(0) 推荐(0)
摘要: // 数值拓展 幂运算符 等同于Math.pow() // 2 10次方 1024 function pow(x, y) { let res = 1 for (let i =0; i < y; i++) { res *= x } return res } console.log(pow(2, 10) 阅读全文
posted @ 2021-03-10 15:42 贺可英 阅读(129) 评论(0) 推荐(0)
摘要: // async await 异步 // function foo() { // return 'hky' // } // console.log(foo()) // async function foo() { // async返回的是一个Promise对象 // return 'hky' // 阅读全文
posted @ 2021-03-10 15:19 贺可英 阅读(51) 评论(0) 推荐(0)