main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
633 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 | var $ = require('../internals/export');
|
---|
3 | var aSet = require('../internals/a-set');
|
---|
4 | var remove = require('../internals/set-helpers').remove;
|
---|
5 |
|
---|
6 | // `Set.prototype.deleteAll` method
|
---|
7 | // https://github.com/tc39/proposal-collection-methods
|
---|
8 | $({ target: 'Set', proto: true, real: true, forced: true }, {
|
---|
9 | deleteAll: function deleteAll(/* ...elements */) {
|
---|
10 | var collection = aSet(this);
|
---|
11 | var allDeleted = true;
|
---|
12 | var wasDeleted;
|
---|
13 | for (var k = 0, len = arguments.length; k < len; k++) {
|
---|
14 | wasDeleted = remove(collection, arguments[k]);
|
---|
15 | allDeleted = allDeleted && wasDeleted;
|
---|
16 | } return !!allDeleted;
|
---|
17 | }
|
---|
18 | });
|
---|
Note:
See
TracBrowser
for help on using the repository browser.