1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-09-20 14:01:55 +00:00
musix-oss/node_modules/core-js/internals/collection-delete-all.js

17 lines
526 B
JavaScript
Raw Normal View History

2020-03-03 20:30:50 +00:00
'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;
};