Quantcast
Channel: Active questions tagged ruby - Stack Overflow
Viewing all articles
Browse latest Browse all 4619

ruby** reverse array without using reverse method

$
0
0

This is my array and custom method to reverse an array output without using the reverse method. not sure where it broke, tried running it in console, no dice.

numbers = [1, 2, 3, 4, 5, 6]def reversal(array)  do |item1, item2| item2 <=> item1endp reversal(numbers)

Viewing all articles
Browse latest Browse all 4619

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>