Created
May 31, 2017 20:11
-
-
Save daliborgogic/f5603e178b7d9d8a50843e8471dcf8f6 to your computer and use it in GitHub Desktop.
Native string.padStart() and string.padEnd()
This file contains hidden or 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
$ node -v | |
> v8.0.0 | |
$ node | |
> let codeName = 'carbon' | |
undefined | |
> codeName.padStart(10) | |
' carbon' | |
> codeName.padEnd(10) | |
'carbon ' | |
> codeName.padStart(10, '123') | |
'1231carbon' | |
> codeName.padEnd(10, '123') | |
'carbon1231' | |
> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment