- Home /
Question by
MasterGalaxy · Jan 13, 2014 at 07:49 AM ·
javascriptenumnested
Put an enumerable inside another enumerable (js)
I ran across a situation where I needed a list of lists, for lack of a better term. Basically I'm looking for a way to have an enumerable as an option inside another enumerable.
To put it another way, image you need a list of ingredients, so you categorize it into dairy, veggies, fruit, and meat. Now you want specific foods, so in fruit you might put apple, orange, banana, and pear. How can I do that in a JavaScript?
I have to admit I mulled this over for a while, but I must just be missing a simple solution. Any help is greatly appreciated.
Comment
Your example would be better represented as a
Dictionary<string, List<string>>
I suppose so, or as
enum list {subList, String}
enum subList {optionOne, optionTwo}
something along those lines
Your answer
![](https://koobas.hobune.stream/wayback/20220613130239im_/https://answers.unity.com/themes/thub/images/avi.jpg)