it
expression ? expression : expression
like C. This is actually a bit weaker because JavaScript is not very typed. Thus, two possible operator “forks” can lead to different types of values.
In this way:
alert(document.all ? "Hello from IE!" : "Hello from a non-IE browser!");
In most cases, the differences between Microsoft ECMAScript and other browsers (or other server environments) are actually not that big, and for regular code other than the DOM, you rarely have to deal with such things.
source
share