In my code, I use a function in another, where the inner one returns a value. Like that:
function first(){
/*do stuff*/
return stuff;
}
function second(){
var result = first;
}
But my problem is the second function doesn't wait the first one and thus, I get a undefined return.
How can I force a function to wait another to get a synchronous function ?