摘要:
1、可以通过Array.from转换为数组 console.log(Array.from('str')); 2、可转换为数组:所有可遍历的 字符串、Set、Map、Nodelist、arguments 3、 阅读全文
posted @ 2021-10-27 19:44
莫等闲O(∩_∩)O~~
阅读(105)
评论(0)
推荐(0)
摘要:
1、去掉首尾空格 console.log(' adc'.trimStart()) //adc,trimStart可以写成trimLeft 阅读全文
posted @ 2021-10-27 11:26
莫等闲O(∩_∩)O~~
阅读(49)
评论(0)
推荐(0)
摘要:
1、用于补全字符串 console.log('x'.padstart(3,'ad')); //adx ,字符串总长度为3,字符串开头添加ad console.log('x'.padstart(4,'ad')); //adax console.log('x'.padend(5,'ad')); //xa 阅读全文
posted @ 2021-10-27 11:11
莫等闲O(∩_∩)O~~
阅读(70)
评论(0)
推荐(0)

浙公网安备 33010602011771号