Although the type of the variable is correctly number, function keeps returning it undefined
Advertisements purpose of this code is recursively sum the digits of a number. like; 473 -> 4+7+3 = 14 -> 1+4 = 5 and stop here. All of the functions seem to be working correct except, in the last function there is an if check to check if the number is below 10. inside the… Read More Although the type of the variable is correctly number, function keeps returning it undefined