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