For this Question: Given a number String S, Your task is to find the sum of the numbers.<b>User Task:</b>
Since this will be a functional problem, you don't have to take input. You just have to complete the function <b>Sum()</b> that takes the String S as a parameter.

Constraints:-
1 <= |S| <= 1000

Note:- String will contain only numbers from 0-9.Return the sum of the string.Sample Input:-
123

Sample Output:-
6

Sample Input:-
123456789

Sample Output:-
45, I have written this Solution Code: // str is input string
function Sum(str) {
    // write code here
    // do not console.log
    // return the sum
    
    return str.split('').map(Number).reduce((a,b)=>a+b,0)
}, In this Programming Language: JavaScript, Now tell me if this Code is compilable or not?