Getting a compass point from 140°
By looking at values in your series of if's, you can make an array ([]), then calculate which index to pick:

var convert = {
    toCompass: function(degrees)
    {
        return ['N', 'NNE', 'NE', 'ENE', 'E', 'ESE', 'SE', 'SSE', 'S', 'SSW', 'SW', 'WSW', 'W', 'WNW', 'NW', 'NNW', 'N'][Math.round(degrees / 11.25 / 2)];
    }
}

alert(convert.toCompass(140));      // SE


JSFiddle demo