Skip to content

Instantly share code, notes, and snippets.

@anmolsukki
Created September 20, 2020 08:17
Show Gist options
  • Save anmolsukki/478318bf19f0b0906dbf1c4cad535a7f to your computer and use it in GitHub Desktop.
Save anmolsukki/478318bf19f0b0906dbf1c4cad535a7f to your computer and use it in GitHub Desktop.
[ Javascript ]

Shorten Function

shorten = (text) => {
  return text.substr(0, 50) + "..."
}
<p>{this.shorten(description)}</p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment