What's the difference between a.sort and a.sort! ?
top 5
68 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.

    Submissions will be graded on the following criteria:
  • Meets Deliverables
  • Creativity
  • Clarity
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
Submission questions
Drag and drop photos or image files into your solution 0 characters Average: 1670 characters
    Your solution must be at least 0 characters long