Three ways to repeat a string in JavaScript
Sonya Moisset

For approach 3, do you even need the ‘if’? Can’t the function just call .repeat() with whatever count is passed in? Looking at the polyfill for repeat(), it seems this should handle any value of count. Interesting that the polyfill uses a ‘for’ loop but there is some weirdness I don’t understand in how it’s counting down. (At least what’s listed in the .repeat() MDN link). Also note my comment on the recursion approach.