add zeros to string js code example Example: Javascript adding zeros to the beginning of a string const number = 5; number.toString().padStart(2, '0');