• Variable inversion-calculation procedure?

I would like to give some feedback about ... https://js.checkio.org/mission/count-inversions/solve/

I'm not clear on how the third condition, i.e.,

assert.equal(countInversion([5, 3, 2, 1, 0]), 10, "Reversed");

evaluates to "10 inversions," rather than 4.

HTTP_USER_AGENT:

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36