Recursive method to add sum of integers

In this small article I am going to show you how we can easily perform a recursive method to add sum of integers till the given number.

let sum = (n)=> n ? n + sum(n-1) : n;

Leave a Reply

Your email address will not be published. Required fields are marked *