摘要: <script type="text/javascript"> //反转字符口串 //abcdefg //转大写 //1.split() 把字符串切割成数组 //2.reverse() 反转数组 //3.join() 把数组链接成字符串 //4.toUpperCase() 字符串转大写 var st 阅读全文
posted @ 2020-04-16 13:02 阿向向 阅读(407) 评论(0) 推荐(0) 编辑
摘要: <script type="text/javascript"> //字符串常用方法(不改变原始字符串) <ES5 var str='hello world' //1.charAt() 按照索引查找字符串的内容,并返回 //语法:字符串.charAt(需要查找的索引 ) //返回值:对应索引上的字符串 阅读全文
posted @ 2020-04-16 12:38 阿向向 阅读(362) 评论(0) 推荐(0) 编辑
摘要: <script type="text/javascript"> var arr=['hello','world','Jack','Rose','world'] //1.indexOf() 查看数组中是否存在该内容 //第一种使用方式 //语法:数组.indexOf(需要查找的内容) //不改变原始数 阅读全文
posted @ 2020-04-16 08:09 阿向向 阅读(154) 评论(0) 推荐(0) 编辑
摘要: <script type="text/javascript"> var arr=['hello','world','sql','linux'] //5.concat() 对数组进行拼接 可拼接多个数组 //语法:数组.concat(拼接的内容) //不改变原始数组 //数组添加在末尾 //返回值:原 阅读全文
posted @ 2020-04-16 08:08 阿向向 阅读(156) 评论(0) 推荐(0) 编辑
摘要: <script type="text/javascript"> //数组常用方法1(只能是数组使用) var arr=[1,2,3,4,5] //1.push() 向数组中添加数据 //语法 数组.push(需要添加的数据) //直接改变原始数组 //放在数组末尾 //返回值 :添加数据后数组长度 阅读全文
posted @ 2020-04-16 08:07 阿向向 阅读(502) 评论(0) 推荐(0) 编辑