原题目:
Given two integers a and b, which can be positive or negative, find the sum of all the numbers between including them too and return it. If the two numbers are equal return a or b.
Note: a and b are not ordered!
Examples:GetSum(1, 0) == 1 // 1 + 0 = 1 GetSum(1, 2) == 3

该博客讨论了如何在JavaScript中找到两个整数a和b之间(包括a和b)所有整数的和。无论a和b的正负,都需返回这些整数的总和。当a等于b时,返回a或b。文中包含具体的代码实现。

1897

被折叠的 条评论
为什么被折叠?



