Object = {"o":"s","e":"w"}
If I have this object, is there a way to perform reverse lookups on it? Something like:
Object.invert()["s"]
> "o"
You want to revert the key/value mapping.
var test = {a: "b", c: "d"}
var reverted = {}
for(var key in test) {
reverted[test[key]] = key
}