DEV Community

Discussion on: Daily Challenge #257 - Halving Sum

Collapse
 
miketalbot profile image
Mike Talbot ⭐
const half = n => n > 0 ? n + half(n>>1) : n
Collapse
 
qm3ster profile image
Mihail Malo
const half = n => n && half(n>>1) + n

:v