A little experiment on doing Axel's stringRepeat function with recursion
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
.gitignore
.travis.yml
README.md
index.js
package.json

README.md

Travis CI Test Status

A simple test to see if I could use recursion to implement the stringRepeat method from Axel's blog post on repeating strings efficiently

function repeat(num, str) {
    num = Number(num);

    if (num === 0) {
        return '';
    }

    return repeat(num >>> 1, str + str) + (num & 1 ? str : '');
}