Last active
August 29, 2018 11:59
-
-
Save kounelios13/1beede9a9cb662274e1d116e4bbc7744 to your computer and use it in GitHub Desktop.
Sum list of numbers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let int = i => parseInt(i,10); | |
let numbers=prompt("Enter numbers seperated by comma").split(',').map(Number); | |
let sum = numbers.reduce((sum,val)=>sum+val); | |
alert("Sum of numbers = ->"+sum); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment