From 15d4dd07e753ef8dadee736bf16560d9a150ca41 Mon Sep 17 00:00:00 2001 From: MaoShizhong <122839503+MaoShizhong@users.noreply.github.com> Date: Tue, 4 Feb 2025 03:48:41 +0000 Subject: [PATCH] Tidy up comment style --- 02_repeatString/repeatString.spec.js | 15 ++++++++------- .../solution/repeatString-solution.spec.js | 15 ++++++++------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/02_repeatString/repeatString.spec.js b/02_repeatString/repeatString.spec.js index 305bce2..b075f33 100644 --- a/02_repeatString/repeatString.spec.js +++ b/02_repeatString/repeatString.spec.js @@ -17,14 +17,15 @@ describe('repeatString', () => { expect(repeatString('goodbye', -1)).toEqual('ERROR'); }); test.skip('repeats the string a random amount of times', function () { - /*The number is generated by using Math.random to get a value from between - 0 to 1, when this is multiplied by 1000 and rounded down with Math.floor it - equals a number between 0 to 999 (this number will change everytime you run - the test).*/ + /* The number is generated by using Math.random to get a value from between + 0 to 1, when this is multiplied by 1000 and rounded down with Math.floor it + equals a number between 0 to 999 (this number will change everytime you run + the test). - // DO NOT use Math.floor(Math.random() * 1000) in your code, - // this test generates a random number, then passes it into your code with a function parameter. - // If this doesn't make sense, you should go read about functions here: https://www.theodinproject.com/paths/foundations/courses/foundations/lessons/fundamentals-part-3 + DO NOT use Math.floor(Math.random() * 1000) in your code, + this test generates a random number, then passes it into your code with a function parameter. + If this doesn't make sense, you should go read about functions here: + https://www.theodinproject.com/paths/foundations/courses/foundations/lessons/fundamentals-part-3 */ const number = Math.floor(Math.random() * 1000) /*The .match(/((hey))/g).length is a regex that will count the number of heys in the result, which if your function works correctly will equal the number that diff --git a/02_repeatString/solution/repeatString-solution.spec.js b/02_repeatString/solution/repeatString-solution.spec.js index a9ca13e..74c3d6f 100644 --- a/02_repeatString/solution/repeatString-solution.spec.js +++ b/02_repeatString/solution/repeatString-solution.spec.js @@ -17,14 +17,15 @@ describe('repeatString', () => { expect(repeatString('goodbye', -1)).toEqual('ERROR'); }); test('repeats the string a random amount of times', function () { - /*The number is generated by using Math.random to get a value from between - 0 to 1, when this is multiplied by 1000 and rounded down with Math.floor it - equals a number between 0 to 999 (this number will change everytime you run - the test).*/ + /* The number is generated by using Math.random to get a value from between + 0 to 1, when this is multiplied by 1000 and rounded down with Math.floor it + equals a number between 0 to 999 (this number will change everytime you run + the test). - // DO NOT use Math.floor(Math.random() * 1000) in your code, - // this test generates a random number, then passes it into your code with a function parameter. - // If this doesn't make sense, you should go read about functions here: https://www.theodinproject.com/paths/foundations/courses/foundations/lessons/fundamentals-part-3 + DO NOT use Math.floor(Math.random() * 1000) in your code, + this test generates a random number, then passes it into your code with a function parameter. + If this doesn't make sense, you should go read about functions here: + https://www.theodinproject.com/paths/foundations/courses/foundations/lessons/fundamentals-part-3 */ const number = Math.floor(Math.random() * 1000); /*The .match(/((hey))/g).length is a regex that will count the number of heys in the result, which if your function works correctly will equal the number that