Rosetta Code: Compare a list of strings

I’ve finished this task and after running the tests I get all of them ok except for the last one:

X azSorted(["BB", "AA"]) returns false.

On the console I read:

azSorted([“BB”, “AA”]) returns false.

So the code is in fact giving the expected answer, but the test fails to pass.

Here’s the link of the challenge:

And this is my code:

function allEqual (arr) {
// Good luck!
if (arr.length < 2){
return true;
let word = arr.pop();
return arr.every((element) => (element == word));

function azSorted (arr) {
// Good luck!
let sorted = true;
let i = 1;
while ((sorted) && (i < arr.length)){
sorted = (arr[i-1] < arr[i]);
return sorted;

console.log(azSorted([“BB”, “AA”]));

Can anyone check if this is correct or there is a bug that can be fixed?

where you able to solve the issue? I don’t see any reason for which it could give the wrong output.

As I never got an answer I moved on. Just today I saw your reply and tried to run it again as it was. It passes the tests, so it was probably just a bug on the testing side.