Created
August 2, 2018 07:01
-
-
Save jportella93/6204a4dd554fd9e9d6c37f059a070ca8 to your computer and use it in GitHub Desktop.
If string goes over character limit, slice it and add '...' at the end
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
const sliceExtra = (str, limit) => str.length < limit ? str : str.slice(0, limit) + '...' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment