javascript - How to call 2 child functions in one main function -


i have several functions in javascript results want use in if statement in function.

my problem first listed child function seems returning result. when swap order of functions around still returning result child function listed first.

i'm beginner , not familiar functions yet. see example below. please specific answers.

function main(a) {   return functone(x);  // name of function "functone" example   return functtwo(y);  // name of function "functtwo" example    if(functone(x)!="true") {     return false;   } else {     if(functtwo(y)!="true) {       return false;     } else {       return true;     }   } } 

you can't return 2 values 1 function. code should

function main(a){ if(functone(x)!="true")   {return false;} else       {if(functtwo(y)!="true")          {return false;} else {return true;}      } } 

Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -