摘要: 一、数组 // 根据中文の首字母排序 let arr = ['上海','北京','广州','深圳'] arr.sort((a, b) => a.localeCompare(b)) console.log(arr) // 数组sort()方法是会改变原数组的,可用slice()浅拷贝一份 // new 阅读全文
posted @ 2023-01-16 23:50 槑孒 阅读(894) 评论(0) 推荐(0) 编辑