开发者

question regarding execution sequence of function in javascript

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?


f1();
f2();

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


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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜