Found a Bug in FCC?

Greetings, I believe I just found a bug in one of the modules. It is module #230 - Sort Arrays with sort. When I put this answer in:

array.sort(function(a, b) {return b-a});

I get a error on the left side of the fake interpreter screen. I get a little red dot with an β€˜x’ in it. However, if I enter this:

array.sort(function(a, b) {
  return b-a;
});

I do not get the error. I found the first code example in W3Schools as correct.
Cheers,
M

It is not a bug. It is letting you know you are missing a semi-colon. It is not required to pass the test, but it is typically good practice.

2 Likes

It’s a syntax error on the first snippet. A semicolon is really expected at the end of return b-a.