摘要: // 替换 html 特殊字符 export function replaceHtmlSymbol(html) { if (html == null) { return '' } return html.replace(/</gm, '&lt;') .replace(/>/gm, '&gt;') . 阅读全文
posted @ 2023-02-07 15:33 DL·Coder 阅读(432) 评论(0) 推荐(0) 编辑
摘要: 初始化 Map,在创建的同时初始化实例,可以给 Map 构造函数传入一个可迭代对象,需要包含键/值对数组。 // 使用嵌套数组初始化映射 const m1 = new Map([ ["key1", "val1"], ["key2", "val2"], ["key3", "val3"] ]); ale 阅读全文
posted @ 2023-02-07 09:22 DL·Coder 阅读(35) 评论(0) 推荐(0) 编辑