摘要: charAt() 用户获得字符串中指定下标的字符 s='abcdef' console.log(s.charAt(0)) //a 注意:只能读,不能写 s='abcdef' s.charAt(0)='c' console.log(s) 运行结果 现在能想到的修改字符串中某个字符的方式就是将字符串转为 阅读全文
posted @ 2021-07-03 13:32 孤城牧笛 阅读(588) 评论(0) 推荐(0)
摘要: 问题 使用Array.sort()方法对数组中的元素进行排序 let arr=[10,2,10,10,10,10,8,2,7,8] arr.sort() console.log(arr) // [ // 10, 10, 10, 10, 10, // 2, 2, 7, 8, 8 // ] 输出结果未实 阅读全文
posted @ 2021-07-03 12:24 孤城牧笛 阅读(177) 评论(0) 推荐(0)