Compute tennis scores - in Node.js