Pretty printing degrees input to radians
Your code looks more complicated than necessary and some of your special cases are really not needed.

I will use an incremental development to avoid unnecessary code:



The first version is just based on the formula, with no additional prettiness: 



function printRadians(angle) {
  return angle + "π" + "/" + 180;
}

document.write([45, 90, 180, 270, 360, -45, -18].map(printRadians).join('  '));






Then we want to simplify the fraction, using, as you did, the gcd function:



function gcd(a, b) {
  return (b == 0)?a:gcd(b, a%b);
}

function printRadians(angle) {
  var _gcd = gcd(angle, 180)
  return angle / _gcd + "π" + "/" + 180 / _gcd;
}

document.write([45, 90, 180, 270, 360, -45, -18].map(printRadians).join('  '));






We are getting nearer, now we should take care of removing unnecessary ones:



function gcd(a, b) {
  return (b == 0)?a:gcd(b, a%b);
}

function printRadians(angle) {
  var _gcd = gcd(angle, 180)
  var numerator = angle / _gcd == 1 ? "" : angle / _gcd;
  var denominator = 180 / _gcd == 1 ? "" : "/" + (180 / _gcd);
  return numerator + "π" + denominator;
}

document.write([45, 90, 180, 270, 360, -45, -18].map(printRadians).join('  '));






And now let's put the minus in front of the numerator, not denominator:



function gcd(a, b) {
  return (b == 0)?a:gcd(b, a%b);
}

function printRadians(angle) {
  var _gcd = gcd(angle, 180);
  var numerator = angle / _gcd == 1 ? "" : angle / _gcd;
  var denominator = 180 / _gcd == 1 ? "" : "/" + Math.abs(180 / _gcd);
  return ((angle &lt; 0 ? "-" : "") + numerator) + "π" + denominator;
}

document.write([45, 90, 180, 270, 360, -45, -18].map(printRadians).join('  '));




And we are done, just \$4\$ lines, with no lengthy ifs for special cases.