1 function ggT(p, q) {2 let r = -1;3 while (r != 0) {4 r = p % q;5 if (r == 0) {6 return q;7 } else {8 p = q;9 q = r;10 }11 }12 }