A
Amir Ebrahimifard
Hi
Why these codes result error ?
1-
array = [*1..10]
sum = array.inject { |memo,item| memo+item if item !=3 }
2-
array = [*1..10]
sum = array.inject { |memo,item| puts memo+item }
Why these codes result error ?
1-
array = [*1..10]
sum = array.inject { |memo,item| memo+item if item !=3 }
2-
array = [*1..10]
sum = array.inject { |memo,item| puts memo+item }