156
Photo by Sara Kurfeß on Unsplash


Sometimes, we may want to truncate long strings in our JavaScript code.
In this article, we’ll look at some good ways to truncate long strings in JavaScript.
We can use the string instance’s substr
method to return a substring given the start…