You are here: irt.org | FAQ | JavaScript | Number | Q1389 [ previous next ]
Try:
<script language="JavaScript"><!-- function isEven(x) { return (x%2)?false:true; } function isOdd(x) { return !isEven(x); } for (var i=0; i < 100; i++) document.write(i + ': even - ' + isEven(i) + ', odd - ' + isOdd(i) + '<br>'); //--></script>