How to get types.type1["color"] from below? I mean how to write public method to get it.
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];
}
}
}();
"missing, after"size": "40Config.getTypes("type1")["color"]?)on last line.