-
Notifications
You must be signed in to change notification settings - Fork 8
Iteratable
James edited this page May 29, 2017
·
1 revision
const ChainedSet = require('../ChainedSet')
const set = new ChainedSet().add('eh')
for (const arr of set) {
const [key, val] = arr
arr.length === 2
key === 0
val === 'eh'
}
for (const val in set.values()) {
console.log(val)
}
const ChainedMap = require('../ChainedMap')
const map = new ChainedMap().set('eh', 'eh!').set('eh2', 'eh2!')
for (const arr of map) {
const [key, val] = arr
arr.length === 2
key.includes('eh') === true
val.includes('eh') === true
}
const obj = map.entries()
for (const prop in obj) {
const val = obj[prop]
console.log({[prop]: val})
}