update snippets 0-All

This commit is contained in:
Stefan Feješ
2017-12-25 14:49:52 +01:00
committed by Agamemnon Zorbas
parent 6bedb8fba4
commit 0c129cdd02
33 changed files with 166 additions and 74 deletions

View File

@ -8,5 +8,8 @@ Return the string truncated to the desired length, with `...` appended to the en
```js
const truncateString = (str, num) =>
str.length > num ? str.slice(0, num > 3 ? num - 3 : num) + '...' : str;
// truncateString('boomerang', 7) -> 'boom...'
```
```js
truncateString('boomerang', 7) -> 'boom...'
```