LoliScript code

Hi,
I wanted to know what the following LoliScript code means:

BEGIN SCRIPT JavaScript
function uuidv4 () {return “xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx” .replace (/ [xy] / g, function (x) {var n = 16 * Math.random () | 0; return (“x” == x? n: 3 & n | 8) .toString (16)})}
var CID = uuidv4 ();
END SCRIPT → VARS “CID”

I would greatly appreciate the explanation.
Thanks.

It makes a random UUID int the variable CID

But what values can x have on the one hand and y on the other?
Can x take the same values as y?