Is “the question of the day” for newbies?
I would feel funny answering most of these, or even worse I could answer them in such a complex way I might throw off, newbie!
As you mentioned above the two most common ways are shown, but I know of a few other methods, which get complex and basically a waste of time to programme. After all I try to write code is the simplest way possible with the fewest lines of code.