soma de javascript positivo

function positiveSum(arr) {
  return arr.reduce((acc, curr) => acc + (curr > 0 ? curr : 0))
}

positiveSum([1,2,-3,4]) // 7
Suman Majhi