1 // Thanks: http://www.2ality.com/2014/01/efficient-string-repeat.html
5 var value = require('../../../object/valid-value')
6 , toInteger = require('../../../number/to-integer');
8 module.exports = function (count) {
9 var str = String(value(this)), result;
10 count = toInteger(count);
11 if (count < 0) throw new RangeError("Count must be >= 0");
12 if (!isFinite(count)) throw new RangeError("Count must be < ∞");
14 if (!count) return result;
16 if (count & 1) result += str;
18 if (count <= 0) break;