find permutations using javascript

recPerm('abc', '');

function recPerm(rest, soFar) {
    var next;
    var remaining;

    if (rest == '') {
    } else {
        for (var i = 0; i < rest.length; i++) {
            remaining = rest.substr(0,i) + rest.substr(i+1,rest.length-1);                 
            next = soFar + rest[i];
            recPerm(remaining, next);




I Am suresh(suresh kumar )a Web developer,Freelancer,webdesigner,UI developer from bangalore. Got 6+ yrs of IT experience . I specialize in standards-based XHTML, CSS and JavaScript web development. Each site I develop is built to be search engine friendly (SEO), using the latest development principles and techniques.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *