Judge each browser

function IEVersion() {
            Var userAgent = navigator.userAgent; //Get the browser's userAgent string
            Var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1; //Check if IE<11 browser
            Var isEdge = userAgent.indexOf("Edge") > -1 && !isIE; //Judge whether IE's Edge browser
            Var isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf("rv:11.0") > -1;
            If(isIE) {
                Var reIE = new RegExp("MSIE (\\d+\\.\\d+);");
                reIE.test(userAgent);
                Var fIEVersion = parseFloat(RegExp["$1"]);
                If(fIEVersion == 7) {
                    Return 7;
                } else if(fIEVersion == 8) {
                    Return 8;
                } else if(fIEVersion == 9) {
                    Return 9;
                } else if(fIEVersion == 10) {
                    Return 10;
                } else {
                    Return 6;//IE version <=7
                }
            } else if(isEdge) {
                Return 'edge';//edge
            } else if(isIE11) {
                Return 11; //IE11
            }else{
                Return -1;//not IE browser
            }
        }