Code change:
<section id='description'> The <code>sort</code> method sorts the elements of an array according to the callback function. For example: <del> <blockquote>function ascendingOrder(arr) {<br>&nbsp;&nbsp;return arr.sort(function(a, b) {<br>&nbsp;&nbsp;&nbsp;&nbsp;return a - b;<br>&nbsp;&nbsp;});<br>}<br>ascendingOrder([1, 5, 2, 3, 4]);<br>// Returns [1, 2, 3, 4, 5]<br><br>function reverseAlpha(arr) {<br>&nbsp;&nbsp;return arr.sort(function(a, b) {<br>&nbsp;&nbsp;&nbsp;&nbsp;return a < b;<br>&nbsp;&nbsp;});<br>}<br>reverseAlpha(['l', 'h', 'z', 'b', 's']);<br>// Returns ['z', 's', 'l', 'h', 'b']</blockquote> </del> <ins> <blockquote>function ascendingOrder(arr) {<br>&nbsp;&nbsp;return arr.sort(function(a, b) {<br>&nbsp;&nbsp;&nbsp;&nbsp;return a - b;<br>&nbsp;&nbsp;});<br>}<br>ascendingOrder([1, 5, 2, 3, 4]);<br>// Returns [1, 2, 3, 4, 5]<br><br>function reverseAlpha(arr) {<br>&nbsp;&nbsp;return arr.sort(function(a, b) {<br>&nbsp;&nbsp;&nbsp;&nbsp;return a === b ? 0 : a < b ? : 1 : -1;<br>&nbsp;&nbsp;});<br>}<br>reverseAlpha(['l', 'h', 'z', 'b', 's']);<br>// Returns ['z', 's', 'l', 'h', 'b']</blockquote> </ins> Note: It's encouraged to provide a callback function to specify how to sort the array items. JavaScript's default sorting method is by string Unicode point value, which may return unexpected results. </section>

Related discussion:
text: Maybe the good ol' if statements are fine here:
Let's see what says after my last reply, before we assign it to you.
Yeah, even I think it is better to make it in the form of as many people still get confused with nested ternaries.
I would take a different perspective here. For the purposes of the tutorial, I suggest that nested ternaries are the way to go. If people do get confused, this will encourage them to look up their doubt and they will be better versed with ternaries for later. I have opened a PR with the edit implementing nested ternaries.
On second thought, and the fact we already have a nested ternary lesson in basic JS section. I think it's fine to use a nested ternary. Good point as well.
Make sure to reference that it closes this issue # if you have not already done so.
just remember to ask first before you create a PR as there might be other people waiting to do one, like had asked here before if he could work on it? sorry about not getting to do a PR for this issue, there are other issues you might take a look at.
I will take care of this in future PRs. Apologies for my mistake .
Comment on issue
What are these PRs you have referenced?
could be spam.
The sample code on the FCC website is still the old version. I noticed on the challenge's GitHub page the sample code is different than what I saw on the live FCC website. I did this challenge on December 19, 2018. The sample code on the FCC website website is the old version (different from the GitHub version). I thought that the GitHub version of the challenge was reflected on the FCC site. Does this happen at regular intervals, or do updated challenges need to be pushed live to the site? As a side note, the sample code on the GitHub page and the live FCC site doesn't work in Chrome 70+ for reasons addressed above. May I update the sample code to a version that works? In this case, the description would also need updating to explain the code. Should I make the changes as a pull request? Sorry, I'm really new to FCC and Open Source contributing in general. I just want to make sure I do things in the most efficient way.