Gold Medal Metrics - ordered medals function

I’m confused on the orderedMedals function in the Gold medal metrics SQL project. Specifically, I’m confused on the purpose of the sortAscending parameter. The answer key doesn’t seem to provide any answers as it uses isAscending as its third parameter, but I assume that they function the same.

Referring to the answer key again, shouldn’t there be an “and” keyword between ${country} and ${orderingString}?

I think I just need a break down of what exactly is going on within this function.

Here is the code I’m referring to within the project for my questions:

const orderedMedals = (country, field, sortAscending) => {
let orderingString = ’ ';
if (field) {
if (sortAscending) {
orderingString = ORDER BY ${field} ASC;
} else {
orderingString = ORDER BY ${field} DESC;
}
}
return SELECT * FROM GoldMedal WHERE country = '${country}' ${orderingString};;;
};

Thanks in advance!