Skip to content

Conversation

Ayoub-Mabrouk
Copy link
Contributor

Replaced the manual loop with padStart to simplify the code and improve readability. This aligns with modern JavaScript practices, making the function more concise and easier to maintain. No functional changesjust a cleaner, more efficient approach to padding numbers with leading zeros.

Replaced the manual loop with `padStart` to simplify the code and improve readability. This aligns with modern JavaScript practices, making the function more concise and easier to maintain. No functional changesjust a cleaner, more efficient approach to padding numbers with leading zeros.
Copy link
Member

@UlisesGascon UlisesGascon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR, @Ayoub-Mabrouk! Can you lint the code?

Replaced the manual loop with `padStart` to simplify the code and improve readability. This aligns with modern JavaScript practices, making the function more concise and easier to maintain. No functional changesjust a cleaner, more efficient approach to padding numbers with leading zeros.
…e manual loop with padStart to simplify the code and improve readability. This aligns with modern JavaScript practices, making the function more concise and easier to maintain. No functional changesjust a cleaner, more efficient approach to padding numbers with leading zeros.
Copy link
Member

@bjohansebas bjohansebas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, this improves the performance of this function

@UlisesGascon UlisesGascon changed the title Refactor zeroPad to use padStart for improved readability refactor: zeroPad to use padStart for improved readability Nov 11, 2024
@UlisesGascon UlisesGascon merged commit e2bf828 into expressjs:master Nov 11, 2024
4 checks passed
@UlisesGascon UlisesGascon mentioned this pull request Mar 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants