Currently, I am in the process of developing a new JavaScript algorithm named jBam (JavaScript Browser Algorithm Module). This algorithm is designed to provide a straightforward method for detecting a browser and its version. My primary objective is to enable users to implement this functionality with ease by using the library in the following manner:
if(IE & version lessThan 9) {
// Execute code specific to IE versions 8 and below
}
I have made significant progress in the development phase. I am now able to write:
if(browser == IE & version < 9)
Therefore, my main query involves the possibility of establishing a variable for lessThan
and assigning it the value of the symbol <
. While I initially attempted the most common approach (var lessThan = <
), I quickly realized that this solution was overly optimistic and simplistic. As we are all aware, nothing is ever too easy. Are there any alternative suggestions or perhaps a JavaScript technique that has eluded me?