Node-Red configuration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

esnext.set.join.js 743B

1234567891011121314151617181920212223
  1. 'use strict';
  2. var $ = require('../internals/export');
  3. var uncurryThis = require('../internals/function-uncurry-this');
  4. var aSet = require('../internals/a-set');
  5. var iterate = require('../internals/set-iterate');
  6. var toString = require('../internals/to-string');
  7. var arrayJoin = uncurryThis([].join);
  8. var push = uncurryThis([].push);
  9. // `Set.prototype.join` method
  10. // https://github.com/tc39/proposal-collection-methods
  11. $({ target: 'Set', proto: true, real: true, forced: true }, {
  12. join: function join(separator) {
  13. var set = aSet(this);
  14. var sep = separator === undefined ? ',' : toString(separator);
  15. var array = [];
  16. iterate(set, function (value) {
  17. push(array, value);
  18. });
  19. return arrayJoin(array, sep);
  20. }
  21. });