Skip to content

Instantly share code, notes, and snippets.

@wongyouth
Created August 14, 2017 01:20
Show Gist options
  • Select an option

  • Save wongyouth/f8cd289e7d763ac11494dff2b80d9113 to your computer and use it in GitHub Desktop.

Select an option

Save wongyouth/f8cd289e7d763ac11494dff2b80d9113 to your computer and use it in GitHub Desktop.
JS Map vs JS Object
1. Map 没有来自 Object.prototype 的属性,比如: __proto__, toString
2. Map 中的key可以是任何类型,Object 只能是 String
3. Map 对象迭代时的顺序与加入时的顺序一致。
ref: https://ponyfoo.com/articles/es6-maps-in-depth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment