Hi I'm having a question related to java script Promise.
var value;
Promise.resolve(await this.triggerAPI_MDBREADMI_GetFGLINHU2()).then(res => {
if (a === 1) {
RequestSearchController.runNumber = res;
} else {
RequestSearchController.runNumber = RequestSearchController.runNumber + 1;
}
value = RequestSearchController.runNumber;
});
console.log(value);
I need to assign the RequestSearchController.runNumber to an external variable, 'value'. But my results are undefined. can someone help me to identify the issue that I have made