Examples with explanations on how to create and use classes in JavaScript with some basic design patterns