Can't seem to add all items in an array

Hello there!

I have some numbers (cost prices of items) in an array which are the values shown under the price column. So at the click of a button, the sum of all the numbers in the array as shown in the alert box in the screenshot below needs to be calculated and displayed where the “$0” is shown in the screenshot below. However, this does not seem to happen. I have tried the “SUM” method, “SUM_BY_KEY” method and also just simply adding the first and 2nd element of the array which also doesn’t work. Can someone please help me with this?

Thanks in advance!

Be careful, check if your numbers are really numbers and not strings.

Thanks for the reply! They were strings before and hence the method never worked. But I thought after changing it to actual numbers it will be fine but it still didn’t work sadly.