Skip to content

Instantly share code, notes, and snippets.

@jportella93
Created August 2, 2018 07:01
Show Gist options
  • Save jportella93/6204a4dd554fd9e9d6c37f059a070ca8 to your computer and use it in GitHub Desktop.
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
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