In comp.lang.javascript message <1171591791.910268.320200@a34g2000cwb.go
oglegroups.com>, Thu, 15 Feb 2007 18:09:51, Isaac Schlueter
<isaacschlueter@gmail.composted:
Quote:
>
>Or my favorite js wtf, found in actual production code at a company
>where I once worked:
>x = (!!x ? !!true : !!false);
>Apparently the author wanted to make really super duper certain he got
>a boolean.
That approach would not be safe in all languages. ISTR one in which
Boolean was nothing more than a predefined enumerated type in the
outermost scope, so that it would be possible to declare new variables
true and false and assign to them respectively 2>3 and 3>2.
--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk DOS 3.3, 6.20 ; WinXP.
Web <URL:http://www.merlyn.demon.co.uk/- FAQqish topics, acronyms & links.
PAS EXE TXT ZIP via <URL:http://www.merlyn.demon.co.uk/programs/00index.htm>
My DOS <URL:http://www.merlyn.demon.co.uk/batfiles.htm- also batprogs.htm.