Some examples illustrating a few commonly used JavaScript patterns