Add line breaks between conditions

This commit is contained in:
Peter Holló
2017-12-30 17:27:37 +01:00
parent 4e16a320e5
commit 7f58d7d27f

View File

@ -5,7 +5,14 @@ Get size of arrays, objects or strings.
Get type of value array, object and string. Use `length` property for arrays. Return `length` or `size` value if available or number of object keys. Split strings into array of characters with `split('')` and return its length.
```js
const size = value => Array.isArray(value) ? value.length : value && typeof value === 'object' ? value.size || value.length || Object.keys(value).length : typeof value === 'string' ? value.split('').length : 0;
const size = value =>
Array.isArray(value)
? value.length
: value && typeof value === 'object'
? value.size || value.length || Object.keys(value).length
: typeof value === 'string'
? value.split('').length
: 0;
```
```js