Basically I have a form with a that chooses which set of data to use (values are \"m\", \"f\" and \"c\"). I then have a dictionary/object with th
You don't have "mode" attribute in that variable. You must use if's to detect which sex you are processing and get gdas.m.fibre
or gdas.f.salt
.
Since you're referencing the property via a variable, you need the bracket notation.
var gda_set = gdas[mode];
...which is the same notation you would use if you were passing a String.
var gda_set = gdas["f"];
You can use gdas[mode], it selects the element that is indexed by the value of mode.