I know that this works. I just don't get the syntax.
I know its checking the OS. just not sure how it works.
var v = navigator.appVe rsion.toUpperCa se()
if (1+v.indexOf('W IN98')
os = 'Win98';
else if (1+v.indexOf('W INNT')
os = 'WinnT';
etc....
ok I know that v is set to whatever the value of the OS is. However,
'indexof' is the kind of function used with an array that tells you
what index a value is at. Why is ther '1+' and where is the '='. I
dont see an if check.
I know its checking the OS. just not sure how it works.
var v = navigator.appVe rsion.toUpperCa se()
if (1+v.indexOf('W IN98')
os = 'Win98';
else if (1+v.indexOf('W INNT')
os = 'WinnT';
etc....
ok I know that v is set to whatever the value of the OS is. However,
'indexof' is the kind of function used with an array that tells you
what index a value is at. Why is ther '1+' and where is the '='. I
dont see an if check.
Comment