const n = "42"; // pad to width 5 with leading zeros console.log(n.padStart(5, "0")); console.log("x".padEnd(4, "."));
padStart and padEnd to a width