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.

string-repeat.js 560B

1234567891011121314
  1. 'use strict';
  2. var toInteger = require('../internals/to-integer');
  3. var requireObjectCoercible = require('../internals/require-object-coercible');
  4. // `String.prototype.repeat` method implementation
  5. // https://tc39.es/ecma262/#sec-string.prototype.repeat
  6. module.exports = function repeat(count) {
  7. var str = String(requireObjectCoercible(this));
  8. var result = '';
  9. var n = toInteger(count);
  10. if (n < 0 || n == Infinity) throw RangeError('Wrong number of repetitions');
  11. for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) result += str;
  12. return result;
  13. };