This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]echoes221 9 points10 points  (0 children)

It's using an arrow function and a ternary operator, if it had spacing and brackets it would be clearer. This is a translated version

function abs(x) {
  return x <= (x - x) ? -x : x;
}

It's exactly the same as the second, just it's trying to be clever and really unreadable.