I am going through codeacademys JavaScript tutorials as i am new to it. The tutorial asks for the following:
Print out the numbers from 1 - 20.
The rules:
Try walking through the logic by hand. If i is 1, then only the last block works. If i is 3, the first block works. If i is 5, the second block works. And if i is 15, the second block works, and the third never gets a chance.
In general, have the most restrictive conditions run before the least restrictive. You should also notice and check carefully when two of your blocks are dissimilar. You have four blocks, and only one is an else block.