I am looking to create a dictionary in Javascript that can return the same result with different keys. Here is an example of what I have tried:
var dictionary = {
[CHW,CW] : { //CHW and CW refer to the same thing
[FLOW,FLW,FW] : 'Result 1' //FLOW, FLW, and FW refer to the same thing (Flow)
}
}
The code above illustrates the concept, but how can I achieve my desired output below?
expected output:
dictionary.CHW.FLW //output: 'Result 1'
dictionary.CW.FLW //output: 'Result 1'
dictionary.CW.FLOW //output: 'Result 1'
dictionary.ABC.EFG //output: undefined
My main objective is to retrieve the same output by using different keys in the dictionary. Is there any library or logic available to accomplish this task? Thank you for your assistance!