{"ScriptPreparationCode":"function repeatify(string, repetitions) {\r\n if (repetitions \u003C 0 || repetitions === Infinity) {\r\n throw new RangeError(\u0027Invalid repetitions number\u0027);\r\n }\r\n \r\n let result = \u0027\u0027;\r\n \r\n for (let i = 0; i \u003C repetitions; i\u002B\u002B) {\r\n result \u002B= string;\r\n }\r\n \r\n return result;\r\n}\r\n\r\nfunction repeatifyWithArrayAndJoin(string, repetitions) {\r\n if (repetitions \u003C 0 || repetitions === Infinity) {\r\n throw new RangeError(\u0027Invalid repetitions number\u0027);\r\n }\r\n \r\n const result = [];\r\n \r\n for (let i = 0; i \u003C repetitions; i\u002B\u002B) {\r\n result.push(string);\r\n }\r\n \r\n return result.join(\u0027\u0027);\r\n}\r\n\r\nfunction repeatifyWithNewArray(string, repetitions) {\r\n if (repetitions \u003C 0 || repetitions === Infinity) {\r\n throw new RangeError(\u0027Invalid repetitions number\u0027);\r\n }\r\n \r\n return new Array(repetitions).join(string);\r\n}\r\n\r\nfunction _checkRepeations(repetitions) {\r\n\tif (repetitions \u003C 0 || repetitions === Infinity) {\r\n throw new RangeError(\u0027Invalid repetitions number\u0027);\r\n }\r\n}\r\n\r\nfunction repeatifyWithNewArrayAndExternalThrow(string, repetitions) {\r\n _checkRepeations(repetitions);\r\n \r\n return new Array(repetitions).join(string);\r\n}\r\n\r\nfunction repeatifyWithNewArrayAndExternalThrowWithProps(string, repetitions) {\r\n this.checkRepeations(repetitions);\r\n \r\n return new this.Array(repetitions).join(string);\r\n}\r\n\r\nvar ctx = {\r\n\tcheckRepeations: _checkRepeations,\r\n \tArray: Array\r\n}\r\n\r\nrepeatifyWithNewArrayAndExternalThrowWithProps = repeatifyWithNewArrayAndExternalThrowWithProps.bind(ctx);\r\n\r\nvar TEST_STRING = \u0027home, sweet home\u0027;\r\nvar COUNT = 1e6;","TestCases":[{"Name":"native repeat","Code":"TEST_STRING.repeat(COUNT);","IsDeferred":false},{"Name":"stupid repeatify","Code":"repeatify(TEST_STRING, COUNT);","IsDeferred":false},{"Name":"repeatifyWithArrayAndJoin","Code":"repeatifyWithArrayAndJoin(TEST_STRING, COUNT);","IsDeferred":false},{"Name":"repeatifyWithNewArray","Code":"repeatifyWithNewArray(TEST_STRING, COUNT);","IsDeferred":false},{"Name":"repeatifyWithNewArrayAndExternalThrow","Code":"repeatifyWithNewArrayAndExternalThrow(TEST_STRING, COUNT);","IsDeferred":false},{"Name":"repeatifyWithNewArrayAndExternalThrowWithProps","Code":"repeatifyWithNewArrayAndExternalThrowWithProps(TEST_STRING, COUNT);","IsDeferred":false}]}