Update formatting
This commit is contained in:
@ -8,7 +8,7 @@ lastUpdated: 2020-10-22T20:24:44+03:00
|
||||
Unflatten an object with the paths for keys.
|
||||
|
||||
- Use nested `Array.prototype.reduce()` to convert the flat path to a leaf node.
|
||||
- Use `String.prototype.split('.')` to split each key with a dot delimiter and `Array.prototype.reduce()` to add objects against the keys.
|
||||
- Use `String.prototype.split()` to split each key with a dot delimiter and `Array.prototype.reduce()` to add objects against the keys.
|
||||
- If the current accumulator already contains a value against a particular key, return its value as the next accumulator.
|
||||
- Otherwise, add the appropriate key-value pair to the accumulator object and return the value as the accumulator.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user