code: function (x, y) {
      if(isNaN(x) || isNaN(y)) {
          throw new Error();
      }
  
      while (y !== 0) {
          var z = x % y;
          x = y;
          y = z;
      }
  
      return x;
  }
docs: /*
  determines the greatest common divisor using Euklids algorithm