Currently, I am utilizing Lodash to streamline object manipulation. Within my object, there are three nested objects that I would like to iterate through, combining all of their respective children in various combinations. The goal is to include only one item from each list.
Here is a representation of my object:
{
"list_1": {
"1": ".cat-3",
"2": ".cat-5",
"3": ".cat-7"
},
"list_2": {
"1": ".eyes-blue",
"3": ".eyes-brown"
},
"list_3": {
"1": ".jazz",
"2": ".commercial",
"3": ".hip-hop"
}
}
The desired output should look something like this:
.cat-3.eyes-blue.jazz
.cat-3.eyes-blue.commercial
.cat-3.eyes-blue.hip-hop
The sequence of the values is not significant, as long as only one value from each list_
object is utilized in the string. Therefore, variations such as these are acceptable:
.eyes-blue.jazz.cat-3
.eyes-blue.cat-3.commercial
.hip-hop.eyes-blue.cat-3
Below are additional examples:
.cat-3.eyes-brown.jazz
.cat-5.eyes-brown.hip-hop
.cat-7.eyes-blue.hip-hop