• + 1 comment
    function createString(str, ns, n) {
        if (ns > 0) return createString(str+" ", ns-1, n);
        else if (n > 0 && ns === 0) return createString(str+"#", ns, n-1);
        else if (n === 0 && ns === 0) return str;
    }
    
    // Complete the staircase function below.
    function staircase(n) {
       let ns = n.length-1;
        console.log(createString("", ns, n));
    
    }
    

    i was going to add a while loop but i keep getting undefined not sure the problem.