Version 1
[yaffs-website] / node_modules / core-js / library / modules / _string-repeat.js
1 'use strict';
2 var toInteger = require('./_to-integer')
3   , defined   = require('./_defined');
4
5 module.exports = function repeat(count){
6   var str = String(defined(this))
7     , res = ''
8     , n   = toInteger(count);
9   if(n < 0 || n == Infinity)throw RangeError("Count can't be negative");
10   for(;n > 0; (n >>>= 1) && (str += str))if(n & 1)res += str;
11   return res;
12 };