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
Post a Comment