We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ddb3c3f commit 51d8b51Copy full SHA for 51d8b51
repeatstring.js
@@ -0,0 +1,6 @@
1
+//using ES6 repeat() method and ternary operators
2
+
3
+function repeatStringNumTimes(str, num) {
4
+ return num > 0 ? str.repeat(num) : '';
5
+}
6
0 commit comments