Is there a way to make this code more optimized, so I have a generic method that process all the logic and it accepts the few parameters and then it adds the key/value to the object displayData
I'm repeating multiple times to call the myGenericMethod
with different parameters, any thing that I can improve based on what I have here?
my generic method:
displayData = {};
myGenericMethod(param1, param2, param3) {
//do something with parameters.....
//.....get the data from db....
//processed data
//finally adding the
displayData[param1] = processed data
displayData[param2] = processed data
//.....
}
//call the myGenericMethod
this.myGenericMethod('aaa','bbb','ccc');
this.myGenericMethod('ddd','eee','eee');
this.myGenericMethod('fff','fff','fff');
this.myGenericMethod('ggg','ggg','ggg');