Given two integers a and b, which can be positive or negative, find the sum of all the integers between including them too and return it. If the two numbers are equal return a or b.
function GetSum(a, b) {
if(a == b) {
return a
}
else if (a < b) {
return a + GetSum(a+1, b)
} else {
return a + GetSum(a-1, b)
};
}
console.log(GetSum(-1, 2));