Sum Of Digits Using Recursion In Javascript, Time Complexity: O (N), where N is the length of the array.