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

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -