+ 2
How do I return the sum of the positive numbers in my array?
Ruby sum of positive integers in an array https://code.sololearn.com/cwdWczggpue3/?ref=app
4 Respostas
+ 2
First, you're not calling your function
Second, in line 8 you are selecting only the negatives
Finally, use what Matthews says, in the return of your function.
+ 1
hamish def is to define, to call you must write the name where you want it to be executed:
https://www.sololearn.com/Course/Ruby/2721/?ref=app
https://www.sololearn.com/Course/Ruby/2723/?ref=app
0
Cristian Gabriel Mazzulla thanks for your help. How do I call the function is that just by adding def at the start?