function - Return Every THIRD odd number using javascript? -
all trying return every third odd number within specified range.
this 1 bit weird me, tried few different things nothing worth posting attempts yielded no results close looking for, have feeling out of scope of current capabilities, appreciated. in advance.
try
<script> var range = 100; var j = -1; (i = 0; <= range; i++) { if (i % 2 == 1) { j++; if (j % 3 == 0) { alert(i); } } } </script>
Comments
Post a Comment