Ad
Code
Diff
  • function numSum(num){
      var r = (num++ * num) / 2;
      return r;
    }
    • function numSum(num){
    • var r = (num * (num + 1)) / 2;
    • var r = (num++ * num) / 2;
    • return r;
    • }