Illumina Interview Question

How to write a JS for-loop.