How to call a function inside another function?

I just want to know how to call a javascript function inside another function. therefore, if I have the code below, how can I call the second function inside the first?

function function_one() { alert("The function called 'function_one' has been called.") //Here I would like to call function_two. } function function_two() { alert("The function called 'function_two' has been called.") } 
+44
javascript function
Dec 24 '10 at 7:26
source share
3 answers

 function function_one() { function_two(); // considering the next alert, I figured you wanted to call function_two first alert("The function called 'function_one' has been called."); } function function_two() { alert("The function called 'function_two' has been called."); } function_one(); 
+78
Dec 24 '10 at 7:28
source share
 function function_one() { function_two(); } function function_two() { //enter code here } 
+19
Nov 13 '12 at 11:25
source share

 function function_one() { alert("The function called 'function_one' has been called.") //Here u would like to call function_two. function_two(); } function function_two() { alert("The function called 'function_two' has been called.") } 
+5
Aug 24 '16 at 13:09 on
source share



All Articles