JavaScript Zero Pad

const str = "5";
str.padStart(4, "0"); // "0005"
HosseinZaaferani