Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sumOfNumbers(input) {
- let number = input[0];
- let sum = 0;
- for(let i = 0; i < number.length; i++){
- sum += Number(number[i]);
- }
- console.log(`The sum of the digits is:${sum}`);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement