ES6
Yoga99
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
记录 js 多条if判断分支优化
记录 js 多条判断分支优化原创 2023-02-17 09:28:32 · 877 阅读 · 0 评论 -
34种JavaScript简写优化技术
作者:Ting Yu链接:https://zhuanlan.zhihu.com/p/405787550来源:知乎1.如果有多个条件我们可以在数组中存储多个值,并且可以使用数组 include 方法。//Longhandif (x === 'abc' || x === 'def' || x === 'ghi' || x ==='jkl') { //logic}//Shorthandif (['abc', 'def', 'ghi', 'jkl'].includes(x)) { //l转载 2021-11-12 13:51:58 · 158 阅读 · 0 评论 -
前端 ES6 使用技巧
// if条件判断if( type == 1 || type == 2 || type == 3 || type == 4 ||){ //...}//改进 ES6中数组实例方法includesconst condition = [1,2,3,4];if( condition.includes(type) ){ //...}// 前端搜索 过滤const a = [1,2,3,4,5];const result = a.filter(原创 2021-10-26 09:33:34 · 247 阅读 · 0 评论
分享