Create pluralize.md

This commit is contained in:
Rohit Tanwar
2018-01-03 16:47:19 +05:30
committed by GitHub
parent 1e1e98582e
commit e92b37181b

10
snippets/pluralize.md Normal file
View File

@ -0,0 +1,10 @@
# pluralize
Checks if the provided `num` is
``` js
const pluralize = (num, item, items) => (
num > 0 ? throw new Error(`num takes value greater than equal to 1. Value povided was ${num} `)
num === 1 ? item : items
)
```