I am trying to solve this function challenge and get the requested output. I tried to come up with a solution but this is beyond my me. Please help me understand this so I can solve this challenge,
I researched using an array but I don't know how to separate the elements(integers) so I can add them.
function getSumOfDigits(num) {
return num + num;
}
/* Do not modify code below this line */
console.log(getSumOfDigits(42), '<-- should be 6');
console.log(getSumOfDigits(103), '<-- should be 4');
I am not getting an error message but the input is returning the wrong output.