views:

44

answers:

2

hello friends my question is i am having two function f1 and f2 and if i want to execute function f2 after execution of f1 how is it possible?

+2  A: 
f1();
f2();

JavaScript is single-threaded, so code is executed linear-ly (is that a word?).

Coronatus
Sequentially. __
KennyTM
+1  A: 

You will have to be a little bit more clear about that

You can have

function f2(){
}

function f1(){
   //do something
   f2();
}

or

function f2(){
}

function f1(){
}

function f3(){
   f1();
   f2();
}
astander