Pad to 3 / three digits / characters

PHOTO EMBED

Tue Jun 22 2021 12:48:17 GMT+0000 (Coordinated Universal Time)

Saved by @hisam #javascript #vanilla

const padToThreeDigits = (num) => (num <= 999 ? `00${num}`.slice(-3) : num); 
content_copyCOPY