摘要: 一. String扩展 1. matchAll()方法 matchAll() 方法返回一个包含所有匹配正则表达式及分组捕获结果的迭代器 matchAll之前,还有exec、match、replace等 function selectDiv(regExp, str) { let matches = [ 阅读全文
posted @ 2021-04-26 17:20 Yaopengfei 阅读(259) 评论(1) 推荐(0)
摘要: 一. Object扩展 1. Object.fromEntries() 方法 Object.fromEntries() 把键值对列表转换为一个对象,这个方法是和 Object.entries() 相对的。 Object.fromEntries([ ['foo', 1], ['bar', 2] ]) 阅读全文
posted @ 2021-04-26 16:47 Yaopengfei 阅读(231) 评论(1) 推荐(0)