Illumina interview question

How to write a JS for-loop.