Last change
on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
714 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 | var $ = require('../internals/export');
|
---|
3 | var IS_PURE = require('../internals/is-pure');
|
---|
4 | var anObject = require('../internals/an-object');
|
---|
5 | var getSetIterator = require('../internals/get-set-iterator');
|
---|
6 | var iterate = require('../internals/iterate');
|
---|
7 |
|
---|
8 | // `Set.prototype.join` method
|
---|
9 | // https://github.com/tc39/proposal-collection-methods
|
---|
10 | $({ target: 'Set', proto: true, real: true, forced: IS_PURE }, {
|
---|
11 | join: function join(separator) {
|
---|
12 | var set = anObject(this);
|
---|
13 | var iterator = getSetIterator(set);
|
---|
14 | var sep = separator === undefined ? ',' : String(separator);
|
---|
15 | var result = [];
|
---|
16 | iterate(iterator, result.push, { that: result, IS_ITERATOR: true });
|
---|
17 | return result.join(sep);
|
---|
18 | }
|
---|
19 | });
|
---|
Note:
See
TracBrowser
for help on using the repository browser.