aboutsummaryrefslogtreecommitdiffstats
path: root/src/set.js
blob: c755c2c5d14da2a698c9a175a478ae4a130100c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* eslint no-unused-vars: "off" */
class SVGSet extends Set {
  // constructor (arr) {
  //   super(arr)
  // }

  each (cbOrName, ...args) {
    if (typeof cbOrName === 'function') {
      this.forEach((el) => { cbOrName.call(el, el) })
    } else {
      this.forEach((el) => {
        el[cbOrName](...args)
      })
    }

    return this
  }
}