Implementation of Algorithm of 400
in Javascript.
Performance rating is a hypothetical rating that would result from the games of a single event only.
Some chess organizations use the "algorithm of 400" to calculate performance rating.
According to this algorithm, performance rating for an event is calculated in the following way:
For each win, add your opponent's rating plus 400,
For each loss, add your opponent's rating minus 400,
And divide this sum by the number of played games.