fix naming

This commit is contained in:
Stefan Feješ
2017-12-17 15:41:31 +01:00
parent bebe9ec3c4
commit f559030eac
73 changed files with 18 additions and 18 deletions

View File

@ -0,0 +1,10 @@
### Truncate a String
Determine if the string's `length` is greater than `num`.
Return the string truncated to the desired length, with `...` appended to the end or the original string.
```js
const truncateString = (str, num) =>
str.length > num ? str.slice(0, num > 3 ? num - 3 : num) + '...' : str;
// truncate('boomerang', 7) -> 'boom...'
```