is-equal
Version:
Are these two values conceptually equal?
28 lines (23 loc) • 590 B
JavaScript
// TODO: delete in next semver-major
module.exports = function getCollectionsforEach() {
var mapForEach = (function () {
if (typeof Map !== 'function') { return null; }
try {
Map.prototype.forEach.call({}, function () {});
} catch (e) {
return Map.prototype.forEach;
}
return null;
}());
var setForEach = (function () {
if (typeof Set !== 'function') { return null; }
try {
Set.prototype.forEach.call({}, function () {});
} catch (e) {
return Set.prototype.forEach;
}
return null;
}());
return { Map: mapForEach, Set: setForEach };
};
;