摘要: JS字符串常用方法总结 1、toLowerCase(): 把字符串转为小写,返回新的字符串。 var str="Hello World"; var str1=str.toLowerCase(); console.log(str); //Hello World console.log(str1); / 阅读全文
posted @ 2019-12-16 14:26 拥孤入睡 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 最新数组方法(包括es6) 整理目前所用过的数组方法,学习了新增的es6方法。 1 arr.push() 从后面添加元素,返回值为添加完后的数组的长度 let arr = [1,2,3,4,5] console.log(arr.push(5)) // 6 console.log(arr) // [1 阅读全文
posted @ 2019-12-16 14:24 拥孤入睡 阅读(175) 评论(0) 推荐(0) 编辑