Fermat
Search
⌃K

Keys

You can access the keys of a dictionary keys of {[key] to [value] ...}.
Input:
keys of {"Barcelona" to ["Sagrada Familia", "Gaudi"]
"Rome" to ["Colosseum", "Trevi Fountain"]}
Output:
> ["Barcelona", "Rome"]
One interesting usage is to combine the contains and in comparator with this method to check whether a key is within a dictionary.
set people to {"Leonardo da Vinci" to "Polymath"
"Ramon Llull" to "Philosopher"}
if "Ramon Llull" in keys of people:
print people["Ramon Llull"]
end
Output:
> "Philosopher"
Last modified 1yr ago