How to call one function, if executed the other?

How to call one function, if executed the other?
June 8th 19 at 17:17
2 answers
June 8th 19 at 17:19
Solution
function func1 () {
console.log('world')
}

function func2 () {
 console.log('hello') 
 func1() 
}

func2()

So?
Such a variation does not guarantee that func1 will be executed after executing all actions in func2. - violet_Dibbe commented on June 8th 19 at 17:22
if func2 contains asynchronous code, then Yes, but the author did not elaborate. - Krista_Bi commented on June 8th 19 at 17:25
probably he doesn't know about async, so it's best to discuss this point at once, so there are no surprises. - violet_Dibbe commented on June 8th 19 at 17:28
June 8th 19 at 17:21
Solution
https://learn.javascript.ru/promise there are examples how to execute functions in sequence.

Find more questions by tags JavaScript