![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ES7/8/9/10/11+新特性
可口可乐了吗
这个作者很懒,什么都没留下…
展开
-
ES8新特性——async、await、对象方法拓展
async函数和await表达式 async无论返回什么类型的数据都是返回promise对象,除了返回promise对象,则其返回的对象的状态根据子对象的返回状态决定 async function fn(){ // return 'zy'; //Promise {<fulfilled>: 'zy'} //return ;//Promise {<fulfilled>: undefined} return new原创 2022-03-06 14:20:41 · 165 阅读 · 0 评论 -
ES7新特性——includes,**
includes( ) const arr=['我是','好学生','学生']; console.log(arr.includes('学生')); //true console.log(arr.includes('坏学生'));//false 可用indexOf()代替 成功返回元素所在索引,失败返回-1 const arr=['我是','好学生','学生']; console.log(arr.index原创 2022-03-06 10:27:35 · 48 阅读 · 0 评论