Add iteration to the README.
This commit is contained in:
parent
d4d8ea6cf2
commit
1269411771
@ -163,6 +163,22 @@ col.on('remove', (removed) => {
|
||||
})
|
||||
```
|
||||
|
||||
### Iteration
|
||||
|
||||
```javascript
|
||||
for (let [key, value] of col) {
|
||||
console.log('- %s: %j', key, value)
|
||||
}
|
||||
|
||||
for (let key of col.keys()) {
|
||||
console.log('- %s', key)
|
||||
}
|
||||
|
||||
for (let value of col.values()) {
|
||||
console.log('- %j', value)
|
||||
}
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
### Installing dependencies
|
||||
|
Loading…
Reference in New Issue
Block a user