Created
November 1, 2019 18:29
-
-
Save ma-9/ebe0a3bd95881de50b4d781f2889c042 to your computer and use it in GitHub Desktop.
JavaScript ES8 Features (padStart and padEnd)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// padStart and padEnd | |
const String = '12345678'; | |
// padStart will add string/padding at the start to justify the Required Length | |
console.log(String.padStart(10,'.')); | |
// Output :- ..12345678 | |
// padEnd will add string/padding at the end to justify the Required Length | |
console.log(String.padEnd(10,'.')); | |
// Output :- 12345678.. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment