Additional tests

This commit is contained in:
Angelos Chalaris
2018-11-10 13:04:37 +02:00
parent 7e22b3fae9
commit 39ff17ae2a
12 changed files with 58 additions and 1 deletions

View File

@ -14,7 +14,7 @@ const toHash = (object, key) =>
```
```js
toHash([4, 3, 2, 1]); // { 0: 4, 1: 3, 2: 2, 1: 1 }
toHash([4, 3, 2, 1]); // { 0: 4, 1: 3, 2: 2, 3: 1 }
toHash([{ a: 'label' }], 'a'); // { label: { a: 'label' } }
// A more in depth example:
let users = [{ id: 1, first: 'Jon' }, { id: 2, first: 'Joe' }, { id: 3, first: 'Moe' }];