Home  >  Q&A  >  body text

函数的运行结果

为什么会运行不出来结果呢?

<script type="text/javascript">
//函数可以像参数一样从一个函数传递到另外一个函数,也可以将一个函数作为另外一个函数的结果返回

function add(a,b)
{
 return a+b;
}
function show(fun,num)
{
    return fun(num,88);
}
show(add,66);

</script>


尼古拉阿列克塞耶维奇奥斯特洛夫斯基尼古拉阿列克塞耶维奇奥斯特洛夫斯基2832 days ago900

reply all(2)I'll reply

  • 数据分析师

    数据分析师2017-09-30 23:24:02

    The running results of the function-PHP Chinese website Q&A-The running results of the function-PHP Chinese website Q&A

    Take a look around and learn.

    reply
    0
  • 巴扎黑

    巴扎黑2016-12-21 11:25:25

    你没有存结果   你可以用个变量存起来   比如var sum=show(add,66);    console.log(sum);

    或者直接看结果console.log(show(add,66))


    reply
    0
  • Cancelreply