In js | Sololearn: Learn to code for FREE!

+2

In js

how to stop a function from another function

4/22/2021 3:01:52 PM

JoseD

21 Answers

New Answer

+2

JoseD To stop the execution of a function in JavaScript, use the clearTimeout() method. This function call clears any timer set by the setTimeout() functions. source: https://stackoverflow.com/questions/29149567/stop-javascript-function-execution-from-another-function

+5

What exactly did you mean by "stop a function from another function"? do you mean to stop a loop inside some function from outside the function?

+2

Ipang I have a function "f1" when this finish call a other function "f2" and this call a other Happens four times I want when happen the event "ondbclick" it stops and called a function It's for a intro

+2

JoseD, About calling f1() and f2() you can store their references in an array and call them in turn inside a loop running for 4 times. If that's not what you mean, than please elaborate more, cause I'm not getting your Description. I still don't understand about the "ondblclick" problem.

+2

https://code.sololearn.com/WFBb55Dkgs3G/?ref=app This is the code The "ondbclick" is for skip the intro I dont know if that will be the best way to do it

+2

Right Adarsh Addee bestie ☺️

+2

Same here Adarsh Addee bestie ☺️☺️

+1

JoseD To stop the execution of a function in JavaScript, use the clearTimeout() method. This function call clears any timer set by the setTimeout() functions.

+1

Use clearTimeouy() method

+1

Matiyas Then what happened 🤨🤨

+1

❤️😍Prerana😍❤️ First see my answer and yours it is same so this answer will be duplicate and the other thing you must add your source link on your answer before posting. Thanks

+1

Matiyas I had search it on Google.

+1

Hey brother, sorry to disturb you but if the question is same then how can the answer be different☺️

+1

Always here for you ❤️😍Prerana😍❤️ bestie

+1

Adarsh Addee There is nothing wrong with the answer but when she answers it she has to tell the source. That's it

+1

Adarsh Addee Thanks

+1

Matiyas welcome

0

❤️😍Prerana😍❤️ I have answered this question before you.

0

Adarsh Addee This is the law of sololearn

0

Matiyas we are here to learn anything and everything☺️. Sorry if you get hurted by her answer.