I want to make a dictionary that able to get same result with different keys,
so I did something like this in javascript:
var dictionary = {
[CHW,CW] : { //CHW and CW is ref to same thing
[FLOW,FLW,FW] : 'Result 1' //FLOW, FLW and FW is ref to same thing(Flow)
}
}
The code above only showing the concept, what I should do to get my expected 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 ultimate goal is to able to get the same output by calling different keys in the dictionary. Is there any library/Logic that can do so? Thanks for helping me out!
var x = { a: 3 }; x.b = x.a;