How to use the es6-set.prototype function in es6-set

To help you get started, we’ve selected a few es6-set examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github twilio / twilio-video.js / lib / util / set.js View on Github external
'use strict';

var Set = require('es6-set');

Set.prototype.map = function map(f, _this) {
  f = _this ? f.bind(_this) : f;
  var result = new Set();
  this.forEach(function(a) {
    result.add(f(a));
  });
  return result;
};

module.exports = Set;

es6-set

ECMAScript6 Set polyfill

ISC
Latest version published 2 years ago

Package Health Score

67 / 100
Full package analysis