LeetCode #371 - Sum of Two Integers (JavaScript)

const getSum = (a, b) => {
    if (b === 0) {
        return a;
    } else {
        return getSum(a ^ b, (a & b) << 1);
    }
}