Syntax console.log("x".padEnd(5, "ab")); // xabab See also padStart JavaScript String Prototype Methods ES2017