What is your hint or solution suggestion?
Use the Array.every method to apply boolean tests to the array elements. For the equality function, check if every element is equal to the first element.
The ascending function is somewhat more complicated. You are only running the tests on the second to last array elements. Use all three parameters: the element (v), index (i), and array (a) parameters. The ascending function is always true for the zeroth index (!i ), and for when
v > a[i-1].
const allEqual = arr => arr.every( v => v === arr ) const azSorted = arr => arr.every((v,i,a) => !i || v > a[i-1]);
Challenge: Compare a list of strings
Link to the challenge: