A little experiment on doing Axel's stringRepeat function with recursion
JavaScript
Latest commit 2907e48 Jan 30, 2014 @connrs Add function to README
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 : '');
}