like if i want to return a new array of each element multiplied by 2
go isn’t a functional language, it’s plain imperative forget about map, for is your friend
if you want a new slice (arrays are different in Go btw) - just create one and iterate over the original one * 2
Обсуждают сегодня