// Any

function lePlusGrand(a:any,b:any):boolean { 
    if ( typeof a == "string" && typeof b == "string") { 
        return a.length > b.length; 
    } 
    if ( typeof a == "number" && typeof b == "number" ) { 
        return a > b; 
    } 
    return false; 
}  

alert( lePlusGrand("ab","abc" ) ); // false 
alert( lePlusGrand( 10,8 ) ); // true

type Type1 = string | number;

function lePlusGrand2(a:Type1,b:Type1):boolean { 
    if ( typeof a == "string" && typeof b == "string") { 
        return a.length > b.length; 
    } 
    if ( typeof a == "number" && typeof b == "number" ) { 
        return a > b; 
    } 
    return false; 
}  

alert( lePlusGrand2("ab","abc" ) ); // false 
alert( lePlusGrand2( 10,8 ) ); // true



