commit
1bf69739d9
1 changed files with 1 additions and 1 deletions
|
@ -4,7 +4,7 @@ importance: 4
|
||||||
|
|
||||||
# Create keyed object from array
|
# Create keyed object from array
|
||||||
|
|
||||||
Let's say we received an array of users in the form `{id:..., name:..., age... }`.
|
Let's say we received an array of users in the form `{id:..., name:..., age:... }`.
|
||||||
|
|
||||||
Create a function `groupById(arr)` that creates an object from it, with `id` as the key, and array items as values.
|
Create a function `groupById(arr)` that creates an object from it, with `id` as the key, and array items as values.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue