15. Getting Technical- What is wrong with my code?


#1



Hello. I do not know what is wrong with my code. When I submit my code, it says that I am using sort when I am actually using sort!. Please help, thank you.

https://www.codecademy.com/courses/ruby-beginner-en-ET4bU/3/4?curriculum_id=5059f8619189a5000201fbcb#


Error Message: It looks like you didn't sort the books array in descending order. Did you remember to use .sort! instead of .sort ?

Compiler: ["A Brief History of Time", "A Wrinkle in Time", "Charlie and the Chocolate Factory", "Utopia", "War and Peace"]

books.sort! { |secondBook, firstBook| secondBook <=> firstBook}


#2

Never mind, I figured out what I messed up.


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.