Get property of object in JavaScript

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"];

Leave a Comment