解构赋值
删除对象不需要的属性的值
1 | const obj = { |
交换两个变量的值
1 | let x = 1, y = 2; |
在解构中使用别名
1 | const object = { number: 10 } |
字符串
判断目标字符是否包含某个字符串
1 | let str1 = 'abcdefg'; |
字符串补全
1 | // 从左边开始补全,时间格式补全 |
数组操作
复杂数组筛选
1 | let arr1 = ['1', '2', '3', '4']; |
1 | const obj = { |
1 | let x = 1, y = 2; |
1 | const object = { number: 10 } |
1 | let str1 = 'abcdefg'; |
1 | // 从左边开始补全,时间格式补全 |
1 | let arr1 = ['1', '2', '3', '4']; |