I want to multiplay all element array with number 2. I get After run only one result. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I want to multiplay all element array with number 2. I get After run only one result.

Multiplay all element in array with number 2. https://code.sololearn.com/Wl8JfB2TeJCf/?ref=app

11th Jan 2021, 6:38 AM
Malick Diagne
Malick Diagne - avatar
2 Answers
+ 1
You did it with map. After the keyword return the function is left. Thats why your loop is executed only once.
11th Jan 2021, 7:27 AM
Oma Falk
Oma Falk - avatar
0
2
11th Jan 2021, 6:48 AM
JustSteve