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

docs(set-map): fixed #1155

This commit is contained in:
ruanyf 2023-06-06 16:14:47 +08:00
parent 116b46f5ab
commit 43222de51b

View File

@ -118,7 +118,7 @@ s.delete(2) // true
s.has(2) // false s.has(2) // false
``` ```
下面是一个对比,看看在判断是否包括一个键上面`Object`结构和`Set`结构写法不同。 下面是一个对比,判断是否包括一个键,`Object`结构和`Set`结构写法不同。
```javascript ```javascript
// 对象的写法 // 对象的写法
@ -142,7 +142,7 @@ if (properties.has(someName)) {
} }
``` ```
`Array.from`方法可以将 Set 结构转为数组。 `Array.from()`方法可以将 Set 结构转为数组。
```javascript ```javascript
const items = new Set([1, 2, 3, 4, 5]); const items = new Set([1, 2, 3, 4, 5]);