js两个整数之间求和

const GetSum = (a, b) => {
  let min = Math.min(a, b),
      max = Math.max(a, b);
  return (max - min + 1) * (min + max) / 2;
}

  

posted @ 2018-11-30 10:10  淡然_  阅读(3205)  评论(0编辑  收藏  举报