摘要: /** * 数组转字符串 */ const arr = [1, 3, 5, 7, 9]; // 方法1 const str1 = arr.toString(); // str1: 1,3,5,7,9 // 方法2 const str2 = arr.join('**'); // str2: 1**3* 阅读全文
posted @ 2021-12-24 10:56 冰凝^ 阅读(71) 评论(0) 推荐(0) 编辑
摘要: /** * 数组删除指定项 * item: 要删除的项 * array:要执行删除项的数组 * code: 数组项的唯一字段 */ arrayRemoveItem(item, array, code?: string) { const idx = array.findIndex(ite => { r 阅读全文
posted @ 2021-12-24 10:25 冰凝^ 阅读(226) 评论(0) 推荐(0) 编辑