I have a dictionary of strings to arrays of strings: {"a":["b", "c"]}
. When indexing into the dictionary, I get an array of strings back, but checking if any string is in this array always returns false.
Here is the code setup:
var dict = {
"first":["a", "b", "c"]
}
if("a" in dict["first"]){
// Never hits this line
console.log("Found a!");
}
I'm pretty new to Javascript so I may be missing something about the setup of a dictionary object, but it seems pretty straightforward and I have professional experience in a few C languages so it is fairly disconcerting that this doesn't work. What is wrong here?