Simplfication of function requested [closed]

Is there a quick/elegant equivalent in TypeScript for this?

foo (len : number, str : string) : string
{
    let ret : string = "";
    for (let i = 0; i < len; i++)
    {
        ret += (i + 1) + str;
    }
    return ret;
}



foo (3, "x");     // result: 1x2x3x
foo (4, "baz");   // result: 1baz2baz3baz4baz

Mabe there is some ArrayOf, map, lambda, … but I am not very good in that.