JavaScript to compute points added.