Update formatting

This commit is contained in:
Isabelle Viktoria Maciohsek
2022-01-30 18:34:36 +02:00
parent ae1828e42f
commit fab0a7fa3b
6 changed files with 6 additions and 6 deletions

View File

@ -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.