Modulus
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Modulus

From: shannon <shannondingle@hotmail.co.uk>
Date: Wed Nov 30 2005 - 22:23:59 CET

Hi there,

I'm working on this piece of code, but as i'm new to javascript i don't
understand this and what it means especially the question mark. count
% 2 ==1?

<HTML>
<HEAD><TITLE>EXAM QUESTION</TITLE>
<SCRIPT LANGUAGE="JAVASCRIPT">

var count = 1;

while (count <=8) {
        document.writeln(count % 2 ==1? "XXXXX<br />" : "$$$$<br />");
 ++count;
}

</script>
</head>
<body>
</body>
</html>
Received on Sat Dec 3 04:34:03 2005