您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

_createSet.js 501B

12345678910111213141516171819
  1. var Set = require('./_Set'),
  2. noop = require('./noop'),
  3. setToArray = require('./_setToArray');
  4. /** Used as references for various `Number` constants. */
  5. var INFINITY = 1 / 0;
  6. /**
  7. * Creates a set object of `values`.
  8. *
  9. * @private
  10. * @param {Array} values The values to add to the set.
  11. * @returns {Object} Returns the new set.
  12. */
  13. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  14. return new Set(values);
  15. };
  16. module.exports = createSet;