Last change
on this file since 1ad8e64 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
526 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 | var anObject = require('../internals/an-object');
|
---|
3 | var aFunction = require('../internals/a-function');
|
---|
4 |
|
---|
5 | // https://github.com/tc39/collection-methods
|
---|
6 | module.exports = function (/* ...elements */) {
|
---|
7 | var collection = anObject(this);
|
---|
8 | var remover = aFunction(collection['delete']);
|
---|
9 | var allDeleted = true;
|
---|
10 | var wasDeleted;
|
---|
11 | for (var k = 0, len = arguments.length; k < len; k++) {
|
---|
12 | wasDeleted = remover.call(collection, arguments[k]);
|
---|
13 | allDeleted = allDeleted && wasDeleted;
|
---|
14 | }
|
---|
15 | return !!allDeleted;
|
---|
16 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.