Get the Sum of All Array Elements

Published by Matt in

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

Examples

get_sum_of_elements([2, 7, 4]) ➞ 13

get_sum_of_elements([45, 3, 0]) ➞ 48

get_sum_of_elements([-2, 84, 23]) ➞ 105

Notes

N/A

Watch a quick demo on how Edabit works.