摘要: ES8新特性 async 和 await async 和 await 两种语法结合可以让异步代码像同步代码一样 async 函数 async 函数的返回值为 promise 对象 promise 对象的结果由 async 函数执行的返回值决定 async function fn() {} 1.返回不 阅读全文
posted @ 2020-07-12 16:47 codeDD 阅读(171) 评论(0) 推荐(0) 编辑
摘要: Array.prototype.includes includes 方法用来检测数组中是否包含某个元素,返回 boolean 值 const nums = [1,2,3,4,5]; console.log(nums.includes(1)); // true console.log(nums.inc 阅读全文
posted @ 2020-07-12 16:45 codeDD 阅读(331) 评论(0) 推荐(0) 编辑
摘要: let 声明变量以及特点 1.变量不能重复声明 let a = 1; let a = 2; // Uncaught SyntaxError: Identifier 'a' has already been declared 2.let 作用域为块级作用域 { let b = 1; } console 阅读全文
posted @ 2020-07-12 16:42 codeDD 阅读(305) 评论(0) 推荐(0) 编辑