Exercise: Implement Your Own Any Method
Now, it’s your turn!
Many of us have heard the phrase “Don’t reinvent the wheel”—meaning that we shouldn’t waste time recreating something that’s already been done. But, to better understand the
Any method and practice extension methods, we’re going to do just that. Let’s write our
Any method and call it
HasAny. For this exercise, don’t use the real
To complete this exercise, follow the instructions in the comments. Fill in the body of the
HasAny method in the