Dictionary.<> Find variable with...

I have working boolean Dictionary in JS. I need to find what key has the true and return it. The dictionary is <Int, Boolean>. So I need that int with true. Anyone have the way to do that? Everything I tried just won’t work right. I figured I would for loop it until I hit true. I just dont see a way to return that key. Any ideas?

Do you mean like this:

for(var keyVal:KeyValuePair.<int,boolean> in dict)
{
    if(keyVal.Value == true)
    {
        return keyVal.Key;
    }
}