Learn Basic Algorithmic Thinking by Building a Number Sorter - Step 44

Tell us what’s happening:

Don’t know if it is a bug on the course but I am explicitly returning a - b or b - a but still not passing the step.

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */
// User Editable Region

  const sortedValues = inputValues.sort((a, b) =>  a - b);

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36

Challenge Information:

Learn Basic Algorithmic Thinking by Building a Number Sorter - Step 44

For any reason or the other passing this step requires using the conventional return keyword but the instruction on the step requirement precise to use the explicit return method. Thanks to look in to that @

The problem is that you erased the braces that were given at the start of this exercise and this is not something the step was expecting you to do. You must assume that if code is given, it is given for a reason and should not be adjusted unless explicitly requested by the step.
(And obviously if you kept the braces, then you must add the explicit return as they wished)

I think using explicit return is first taking off the brackets, then return the code without the “Return” keyword learn from previous chapters. unless wrongly taught in initial parts of the course.

you are mixing up the words explicit and implicit. feel free to google their definitions to get clarity on that

1 Like