js中识别字符串里面的内容
2022-04-12 本文已影响0人
远方的诗_web
两个常用的js中识别字符串里面的内容的方法
1、使用split方法
'qwert'.split(''); // 输出 ['q', 'w', 'e', 'r', 't']
2、使用解构
[...'qwert']; // 输出 ['q', 'w', 'e', 'r', 't']
两个常用的js中识别字符串里面的内容的方法
1、使用split方法
'qwert'.split(''); // 输出 ['q', 'w', 'e', 'r', 't']
2、使用解构
[...'qwert']; // 输出 ['q', 'w', 'e', 'r', 't']