如何使用javascript在一个函数中调用多个函数?

时间:2012-09-12 05:07:32

标签: javascript asp.net

我有很多功能。我正在使用asp.net控件。 我想在一个(主)函数中调用所有函数。这是一个返回类型函数。 这必须使用Javascript。

function a(){
    if(b==c){
    return true
}else{
    return false;
}

function b(){
    if(b==c){
        return true;
}else{ 
    return false;
}

function c(){}//return type

函数a,b和c在main函数中称为函数。

 function main()
    {
   //??
    }

此功能不是一项工作。

2 个答案:

答案 0 :(得分:2)

你要么:

function main()
{
  return a() && b() && c() && d(); // all must be true to return true
}

function main()
{
  return a() || b() || c() || d(); // at least 1 must be true to return true
}

答案 1 :(得分:1)