Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialBrett Campbell
14,077 PointsTask 2
I have no idea where I am going wrong. I currently have Task 2 looking like this: saying2.sort(toString.length). Any hints??
2 Answers
Chris Dziewa
17,781 PointsYou need to pass in a function to the sort method that returns a negative number, 0, or positive number by comparing two items in your array. This function will replace what you have within parentheses. If you would like I can share a passing answer.
Brett Campbell
14,077 PointsI figured it out! Thanks for the response though!
Chris Dziewa
17,781 PointsThat's the best way. Good job!