JavaScript学习之小白篇(七-ES5简单介绍)

版权声明:文章为原创作品,转载请注明出处 https://blog.csdn.net/weixin_43654258/article/details/84964916

好好学习 ,天天向上。Are you ready?在这里插入图片描述

一、ES5扩展
1. 严格模式 “use strict”
2. 数组的扩展方法:(都不影响原数组)
1. indexOf()
2. lastIndexOf()
3. forEach(function(value,index,array){})
4. map(function(value,index,array){return …})
5. reduce(function(up,down,index,array){return …})
6. filter(function(value,index,array){return …})
二、如何声明字符串?
1. 字面量的方式
2. 构造函数的方式
三、字符串的属性 length
四、字符串的方法 查替截转(都不影响原字符串)
1. charAt(index)
2. charCodeAt(index)
3. indexOf(‘字符串’)
4. lastIndexOf(‘字符串’)
5. replace(旧串,新串)
6. substring(start,end)
7. substr(start,length)
8. slice(start,end)
9. toUpperCase()
10. toLowerCase()
11. split
五、静态方法:
String.fromCharCode()
六、中文范围 :
0x4e00~0x9fa5

猜你喜欢

转载自blog.csdn.net/weixin_43654258/article/details/84964916