0

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?

1
  • Do you want to execute f2 automatically whenever you invoke f1?? If so function wrapping will be the answer... Commented Apr 2, 2010 at 7:26

2 Answers 2

2
f1();
f2();

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

Sign up to request clarification or add additional context in comments.

Comments

1

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();
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.