'Get the JS return type for this function, JSDoc gets precedence.'

def getReturnType(self):

    bestType = None
    if (self.jsdoc and self.jsdoc.returns):
        bestType = self.jsdoc.returns.paramtype
    elif (len(self.returnTypes) > 0):
        d = {}
        bestCount = 0
        bestType = None
        for rtype in self.returnTypes:
            if isinstance(rtype, (str, unicode)):
                count = (d.get(rtype, 0) + 1)
                d[rtype] = count
                if (count > bestCount):
                    bestType = rtype
    if bestType:
        bestType = standardizeJSType(bestType)
    return bestType
