As you're getting this info from a book on CSS, the author is most likely referring to CSS rules like this:
[if IE]body
{/* only for IE*/
[if IE 6] background: url('get_real.gif');
[if gt IE 6] background: url('nogood_browser.png');
}
[if Webkit]body
{/*Only webkit browsers get this bg*/
background: url('webkit_bg.png');
}
[if Gecko]body
{/*Gecko-based browsers get this*/
background: url('foxy.png');
}
Other than that - On JS:
My guess would be you got the idea from the place all mis-information comes from. Please, for your sake and mine, don't use w3schools.
in case of an if (condition)
, where condition
should read expression
to be correct, it should be truthy, if the expression consists of a single value. In case you are comparing 2 expressions, the conditional expression evaluates to true
or false
, based on how you compare the two operands
Single operand:
if (1)//truthy
if (undefined) //falsy
This is because Boolean(1) === true
and Boolean(undefined) === false
Once you introduce a second operand:
if ('0' == 0)//=== true
if ('0' === 0)// === false
That's because ===
is a type and value check, which you obviously know already. Just so there's no confusion:
If you want to be sure you have the correct information: check the ECMAScript language specs, not some third party resource: here's the link