Question: Javascript -- Write a program called sum_number.js, that calculates the sum of the numbers contained in a string and displays the result. Use a string

Javascript -- Write a program called sum_number.js, that calculates the sum of the numbers contained in a string and displays the result. Use a string containing 2155 as your input value. For example, given the input , let num = 22, I would sum 2 + 2 for a result of 4.

The program needs to be able to run at a command prompt, it is not to be used in a web browser, and there will be no user input, the only input value will be 2155

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!