main
Last change
on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
743 bytes
|
Line | |
---|
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 |
|
---|
8 | var arrayJoin = uncurryThis([].join);
|
---|
9 | var push = uncurryThis([].push);
|
---|
10 |
|
---|
11 | // `Set.prototype.join` method
|
---|
12 | // https://github.com/tc39/proposal-collection-methods
|
---|
13 | $({ target: 'Set', proto: true, real: true, forced: true }, {
|
---|
14 | join: function join(separator) {
|
---|
15 | var set = aSet(this);
|
---|
16 | var sep = separator === undefined ? ',' : toString(separator);
|
---|
17 | var array = [];
|
---|
18 | iterate(set, function (value) {
|
---|
19 | push(array, value);
|
---|
20 | });
|
---|
21 | return arrayJoin(array, sep);
|
---|
22 | }
|
---|
23 | });
|
---|
Note:
See
TracBrowser
for help on using the repository browser.