JSFiddle - React, Tailwind, and code Playground

by painotpi

JavaScript

Config = (function(){

var ids = {
      id1: "id1",
      id2: "id2"
  }
var types = {
       type1: {
               "color": "red",
               "size": "10"
              },
        type2: {
               "color": "red",
               "size": "40"
            }
  return {
      getIds: function(id){
            return ids[id];
       }
      getTypes: function(type){
             return types[type];
       }

 }
}();

var oConfig = new Config();

alert(oConfig.types.type1.color);