js
你一定要努力,但千万别着急
这个作者很懒,什么都没留下…
展开
-
宏任务、微任务理解
宏任务、微任务原创 2022-06-26 22:01:47 · 1131 阅读 · 0 评论 -
扁平数组和JSON树的转换
扁平数组和JSON 转换原创 2022-06-24 14:54:56 · 332 阅读 · 0 评论 -
JS优雅小技巧
1. 通过条件判断给变量赋值布尔值// badif (a === 'a') { b = true} else { b = false}// goodb = a === 'a'2. 在if中判断数组长度为零// badif (arr.length === 0) {}// goodif (!arr.length) {}3. 在if中判断数组长度不为零// badif (arr.length !== 0) {}// goodif (arr.length)原创 2021-02-18 10:23:55 · 142 阅读 · 0 评论 -
if else优化
if (this.type === 0) { this.startDate = 0 this.endDate = 0 } else if (this.type === 1) { this.startDate = 1 this.endDate = 1 } else if (this.type === 2) { this.startDate = 2 this.endDate = 2 } else if (this.type === 3) { this.startDate =..原创 2020-12-31 10:47:24 · 174 阅读 · 0 评论