Is it possible to get the last index of a map when the value of the index is unknown?
For example, I would like to do something like this:
In my make-believe world, the above code would print "3", and 'last' would have the value "z".
My initial thought is that this would be difficult in ASH due to typing constraints, but I figured I'd give it a shot. Does such a thing exist?
For example, I would like to do something like this:
Code:
int[string] map;
map["a"] = 8;
map["b"] = 2;
map["c"] = 1;
map["x"] = 4;
map["y"] = 9;
map["z"] = 3;
string last = last_index_of(map);
print ( to_string(map[last]) );
In my make-believe world, the above code would print "3", and 'last' would have the value "z".
My initial thought is that this would be difficult in ASH due to typing constraints, but I figured I'd give it a shot. Does such a thing exist?