Using JavaScript's prototype inheritance nature to apply sorting algorithms, object oriented programming concepts, and design patterns