What's the difference between a.sort and a.sort! ?
top 5
47 months ago
Default challenge

To sort an array a in Ruby, you could either do a.sort or a.sort! . What's the difference between the two? Discuss performance and end result. How would you use them? Provide one example where a.sort is better than a.sort! and one example where a.sort! is better than a.sort.

Top 5 share $75
$15.00 S Rochester Institute of Technology
$15.00 Square pic 60 0203152114 New York University
$15.00 Square pic 60 profile San Francisco State University
$15.00 J University of California at Berkeley
Want to stay up to date with new challenges? Follow us on Instagram under @mindsumo!