You can add a leading zero to single-digit values using the padStart() method, which pads a string with a specified character until it reaches a certain length. For example, you can use the expression String(num).padStart(2, '0') to add a leading zero to a single-digit number.