Recall from the conceptual lesson that the
peek() method will allow us to view the head of the queue without returning it. Let’s implement this functionality in our
Declare a method called
peek() that will return a value of optional type,
String. You should see an error because you haven’t completed the function yet.
peek(), return the value of the first item in our
Queue by directly accessing the head’s data.