You can use the shorthand exp ? if_true : if_false
notation chained together instead of the if ... else
notations. It’s specially used for conditional inline value returns.
[s == "Wolf" ? wolf_gene : s == "Cat" ? cat_gene : s == "Fox" ? fox_gene : ""]
You can also do like this as well:
[({"Wolf": wolf_gene, "Cat": cat_gene, "Fox": fox_gene})[s]]
That’s a great answer! I’ve never thought of these solutions in a while, maybe even add a warning for that so other newbies could know easily.