How can I remove the first and last item on the same line in a smart way?
I tried:
names = %w[Go Go Go Power Rangers Go]
names.shift.pop
It can not be, because, I think, two shiftand popreturn a value, the remote, which is then transmitted to the next function, causing an error.
I also tried to do this work with delete_at, but it does not allow an array parameter, and therefore I do not get any more effort to make it a single layer.
Any ideas?
Note. I value minimalism
source
share