Forum Discussion
Since your conditions are simple string comparisons, I would suggest using an Object Literal to store the values for each key and then using the get() method to do the lookup:
{
objs: {
OBJ1: 'OBJ2',
OBJ3: 'OBJ4',
OBJ5: 'OBJ6',
OBJ7: 'OBJ8',
},
FindObjectID: x => this.objs.get(x, 'UNKNOWN')
}
Related Content
- 3 months ago
- 10 months ago