mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-23 00:45:16 +00:00
17 lines
526 B
JavaScript
17 lines
526 B
JavaScript
|
'use strict';
|
||
|
var anObject = require('../internals/an-object');
|
||
|
var aFunction = require('../internals/a-function');
|
||
|
|
||
|
// https://github.com/tc39/collection-methods
|
||
|
module.exports = function (/* ...elements */) {
|
||
|
var collection = anObject(this);
|
||
|
var remover = aFunction(collection['delete']);
|
||
|
var allDeleted = true;
|
||
|
var wasDeleted;
|
||
|
for (var k = 0, len = arguments.length; k < len; k++) {
|
||
|
wasDeleted = remover.call(collection, arguments[k]);
|
||
|
allDeleted = allDeleted && wasDeleted;
|
||
|
}
|
||
|
return !!allDeleted;
|
||
|
};
|