149k views
5 votes
How to call a variable from another function in javascript

User Jdelange
by
8.0k points

1 Answer

4 votes

Answer:

For simplest case, passing variables to another function might be the best approach to this problem. Return the value you wish to use in functionOne, then call functionOne within functionTwo and place the result into a fresh var. This should enable you to use the var declared in functionOne, within functionTwo.

Step-by-step explanation:

User Sunshinekitty
by
8.6k points

No related questions found

Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.