JS заполняет строку с помощью n символов

var str = new Array(len + 1).join( character );
Frantic Fox