I am trying to finish the execution of the async function and try to go to the next line and I can only achieve this by using the method of promise.
Is there any other method that I can use?
created() {
this.data.forEach(el=>{
this.test().then(res=>{
});
});
//want to wait until finish execution and want to write code here.
}
async test() {
const data = await this.$store.dispatch(
"getData", {
value: value
}
return data;
}