first() {
setTimeout(() => console.log('I am First CALL afer 1 second'), 1000)
}
second() {
console.log("SEcond methof is called");
}
async getMoviesFromApi() {
try {
let response = await this.first() ;
let response2 = this.second() ;
} catch (error) {
console.error(error);
}
}
Here second function should be called after function first and first will print after 1 second but second is called directly , it is not waiting for function first. please help