In this article, I’ll explain how to solve freeCodeCamp’s “Repeat a string repeat a string” challenge. This involves repeating a string a certain number of times.
There are the three approaches I’ll cover:
- using a while loop
- using recursion
- using ES6 repeat() method
If you want to change selection, open document below and click on "Move attachment"
Three ways to repeat a string in JavaScript – freeCodeCampamp | https://sonyamoisset.github.io Feb 13 Three ways to repeat a string in JavaScript In this article, I’ll explain how to solve freeCodeCamp’s “Repeat a string repeat a string” challenge. This involves repeating a string a certain number of times. There are the three approaches I’ll cover: using a while loop using recursion using ES6 repeat() method The Algorithm Challenge Description Repeat a given string (first argument) num times (second argument). Return an empty string if num is not a positive number. < cl Summary
status | not read | | reprioritisations | |
---|
last reprioritisation on | | | suggested re-reading day | |
---|
started reading on | | | finished reading on | |
---|
Details