I have two functions ,function1() and function2() . Below is the structure of code

```
function1(){
 //Inside this function there is one more function(present in different JS file)
  functionA(){ //functionA calls a different function in some other JS file

  } 
}

function2(){

}

```

I tried giving call back so function1() will be executed before function2(). This didn't work.

Can anyone suggest. How can I execute function1()(all the functions inside the function) and then function2()?