Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

array-species-create.js 714B

1234567891011121314151617181920
  1. var isObject = require('../internals/is-object');
  2. var isArray = require('../internals/is-array');
  3. var wellKnownSymbol = require('../internals/well-known-symbol');
  4. var SPECIES = wellKnownSymbol('species');
  5. // `ArraySpeciesCreate` abstract operation
  6. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  7. module.exports = function (originalArray, length) {
  8. var C;
  9. if (isArray(originalArray)) {
  10. C = originalArray.constructor;
  11. // cross-realm fallback
  12. if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
  13. else if (isObject(C)) {
  14. C = C[SPECIES];
  15. if (C === null) C = undefined;
  16. }
  17. } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
  18. };