diff --git a/guide/english/certifications/javascript-algorithms-and-data-structures/basic-algorithm-scripting/repeat-a-string-repeat-a-string/index.md b/guide/english/certifications/javascript-algorithms-and-data-structures/basic-algorithm-scripting/repeat-a-string-repeat-a-string/index.md index ca35597bd6..e621cdc223 100644 --- a/guide/english/certifications/javascript-algorithms-and-data-structures/basic-algorithm-scripting/repeat-a-string-repeat-a-string/index.md +++ b/guide/english/certifications/javascript-algorithms-and-data-structures/basic-algorithm-scripting/repeat-a-string-repeat-a-string/index.md @@ -86,25 +86,6 @@ Make the variable created store the current value and append the word to it. * Functions - Recursion -## ![:rotating_light:](https://forum.freecodecamp.com/images/emoji/emoji_one/rotating_light.png?v=3 ":rotating_light:") Advanced Code Solution: - - function repeatStringNumTimes(str, num) { - return num > 0 ? str.repeat(num) : ''; - } - - repeatStringNumTimes("abc", 3); - -![:rocket:](https://forum.freecodecamp.com/images/emoji/emoji_one/rocket.png?v=3 ":rocket:") Run Code - -### Code Explanation: - -* This solution takes a declarative approach. -* It is similar to the third solution, except it uses the ternary operator form of the `if` statement. - -#### Relevant Links - -* JS Ternary - ## ![:clipboard:](https://forum.freecodecamp.com/images/emoji/emoji_one/clipboard.png?v=3 ":clipboard:") NOTES FOR CONTRIBUTIONS: * ![:warning:](https://forum.freecodecamp.com/images/emoji/emoji_one/warning.png?v=3 ":warning:") **DO NOT** add solutions that are similar to any existing solutions. If you think it is **_similar but better_**, then try to merge (or replace) the existing similar solution.