GitHub 博客园 Nanakon

【avalon】createMap

/**
 * Creates a new object without a prototype. This object is useful for lookup without having to
 * guard against prototypically inherited properties via hasOwnProperty.
 *
 * Related micro-benchmarks:
 * - http://jsperf.com/object-create2
 * - http://jsperf.com/proto-map-lookup/2
 * - http://jsperf.com/for-in-vs-object-keys2
 */
function createMap() {
  return Object.create(null)
}

 

posted on 2016-12-14 15:38  jzm17173  阅读(79)  评论(0编辑  收藏  举报

导航

轻音