1、ES6字符串扩展:
(1).API聚焦:str.indexOf(); str.includes(); str.repeat(num);
(2).模版字符串:``以及${}的使用[都称为模版字符串] -> 优点:更好的处理字符串拼接;语义化更好;防止注入xss;[xss恶意脚本攻击:使用document.write();<script>标签等向页面写入脚本代码,篡改页面 ]
![](https://img.haomeiwen.com/i11823378/16b90ceafee13ce5.png)
![](https://img.haomeiwen.com/i11823378/7d52dc839c5d9e37.png)
![](https://img.haomeiwen.com/i11823378/c8447318bc353372.png)
2、ES6数组扩展 -> Array.of(); Array.from(); arr.find(); arr.findIndex(); arr.fill();
![](https://img.haomeiwen.com/i11823378/8eb8ec37f7996e4b.png)
![](https://img.haomeiwen.com/i11823378/f7b045426958d578.png)
网友评论