1
0
mirror of https://github.com/ruanyf/es6tutorial.git synced 2025-05-24 18:32:22 +00:00

docs(map): fix map #614

This commit is contained in:
ruanyf 2018-02-26 15:20:30 +08:00
parent a13917f1be
commit 52e67f71da

View File

@ -805,7 +805,7 @@ new Map([
**3Map 转为对象**
如果所有 Map 的键都是字符串,它可以转为对象。
如果所有 Map 的键都是字符串,它可以无损地转为对象。
```javascript
function strMapToObj(strMap) {
@ -823,6 +823,8 @@ strMapToObj(myMap)
// { yes: true, no: false }
```
如果有非字符串的键名,那么这个键名会被转成字符串,再作为对象的键名。
**4对象转为 Map**
```javascript