Skip to content

Instantly share code, notes, and snippets.

View gsrai's full-sized avatar

Gagan Srai gsrai

View GitHub Profile
@gsrai
gsrai / timesImpl.js
Created September 10, 2017 14:42
Javascript implementation of times
function times(str, n) {
if (n == 0) {
return '';
}
if (n == 1) {
return str;
} else {
return str + times(str, n - 1);
}