Getting a browser's name client-side


Is there any object or method that returns data about the browser, client-side?

For example, I need to detect if the browser is IE (Interner Explorer). Following is the code snippet.

function isInternetExplorer()
{
    if(navigator.appName.indexOf("Microsoft Internet Explorer") != -1)
    {
        return true;
    }
    return false;
}

Is there a better way?