Adding a Leading Zero in JavaScript
At work, I recently ran into a scenario where we were capturing a user's date of birth (DOB). This information is collected in 3 fields day, month, and year. If your DOB is January 7, 1962, people were inputting 1 for the month, 7 for the day, and 19...
ratracegrad.hashnode.dev1 min read
Ajay
JavaScript enthusiast and React developer building beautiful, responsive UIs.
Short and simple. I implemented the same functionality with if-else conditions and it was verbose, but you just made it very simple - one line. Thanks for the sharing it Jennifer Bland