[Javascript] Using Map to set dynamic key and value

//
const object = {}
object[key] = value

// 👍 better performance
const map = new Map()
map.set(key, value)

 

posted @ 2022-03-30 15:10  Zhentiw  阅读(52)  评论(0编辑  收藏  举报