js 函数重名后面的覆盖前面的

  var x = 1;
    var y = 0;
    var z = 0;
    function add(n) { return n = n + 1; }
    function add(b) { return b = b + 5; }
 y = add(1);
    z = add(3);
    alert(y + z);

 

结果为:14

相关文章:

  • 2022-12-23
  • 2022-01-20
  • 2022-12-23
  • 2021-10-17
  • 2021-09-16
  • 2022-12-23
  • 2022-02-28
  • 2022-02-11
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案