Get the Sum of All Array Elements

Published by xAlien95 in

Create a function that takes an array and returns the sum of all numbers in the array.

Examples

getSum(of: [2, 7, 4]) ➞ 13

getSum(of: [45, 3, 0]) ➞ 48

getSum(of: [-2, 84, 23]) ➞ 105

Notes

N/A

Watch a quick demo on how Edabit works.