Accessing JSON keys #5810
Unanswered
GevinHasmitha
asked this question in
Q&A
Replies: 1 comment
-
Yes, Lodash provides methods to manipulate nested keys in an object while preserving the order. One approach is to use the _.unset() function to remove the nested key, and then use the _.set() function to set a new value with the desired key in the same position. Here's an example:
which will output
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to access and edit a nested key in the json, not the value. I tried unsetting the key value pair and setting a new pair with the key changed but this will add the new pair to the end of the json, i want to preserver the order of the json.
Is this supported?
Beta Was this translation helpful? Give feedback.
All reactions