The finished product

I tried to use a shortcut by duplicating the loop but it turned out
that the shortest code was right in Beginning JavaScript 4th Edition by
Paul Wilton and Jeremy McPeak