Pong replica in JS