You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Your implementation of this function must *not* call String.prototype.repeat (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat).
3
-
// The goal is to re-implement that function, not to use it.
4
-
return"hellohellohello";
1
+
/**
2
+
* Repeats a string a given number of times.
3
+
* This re-implements String.prototype.repeat without using it.
4
+
*
5
+
* @param {string} str - The string to repeat.
6
+
* @param {number} count - How many times to repeat it. Must be 0 or greater.
7
+
* @returns {string} The string repeated count times, or "" if count is 0.
0 commit comments