JSFiddle - React, Tailwind, and code Playground

by jameswiseman

JavaScript

var oTierOptions = {
    AGE : {
        Index : 0,
        Label : "Age",
        Value : "A"
    },
    MEMBERSHIP : {
        Index : 1,
        Label : "Membership",
        Value : "P"
    },
    SERVICE : {
        Index : 2,
        Label : "Service",
        Value : "S"
    },
    PHASING : {
        Index : 3,
        Label : "Phasing",
        Value : "H"
    },
    Self: ["AGE", "MEMBERSHIP", "SERVICE", "PHASING"]
};

var someVar = 2;
alert(oTierOptions[oTierOptions.Self[someVar]].Label);