"The Secret Life of Walter Mitty" is a short story written by James Thurber. In this story, the protagonist, Walter Mitty, frequently finds himself the hero of action-filled daydreams; these daydreams appear to allow him to escape the mundane life he leads in reality.
While Mitty's daydreams are obvious fantasies, they each have some small link with events that take place in Mitty's real life; there is a little bit of foreshadowing before each daydream. For example, Walter Mitty's daydream about being a heroic surgeon is preceded by his driving past a hospital; he fantasizes about being on trial after he hears a newsboy shouting about the Waterbury trial; and Mitty imagines being a Captain when he sees pictures of World War II in an old magazine. These hints of what to come are examples of foreshadowing.
In the opening sentences of "The Secret Life of Walter Mitty" there is a subtle foreshadowing of the very last scene of the story. The story opens abruptly:
“We’re going through!” The Commander’s voice was like thin ice breaking. He wore his full-dress uniform, with the heavily braided white cap pulled down rakishly over one cold gray eye. “We can’t make it, sir. It’s spoiling for a hurricane, if you ask me.”
Walter Mitty is driving his wife to town for her weekly visit to her hairdresser. Although the author does not say what triggers this particular fantasy about commanding a hydroplane in hurricane weather, the reader will realize in retrospect that Mitty must have noticed a few admonitory drops on his windshield and dark clouds gathering on the horizon. A storm is brewing. He will have to get to town and back to their country home, probably driving through rain and even through some falling snow on the way back.
Then at the end of the story the storm has broken.
It began to rain, rain with sleet in it. He stood up against the wall of the drugstore, smoking. . . . He put his shoulders back and his heels together. “To hell with the handkerchief,” said Walter Mitty scornfully. He took one last drag on his cigarette and snapped it away.
This rounds the story out, giving it a beginning and an end. Mitty undoubtedly has many other fantasies. In fact, he probably lives in a fantasy world most of the time. But this foreshadowing and then the arrival of what was foreshadowed put a frame around the story, proving an appropriate and satisfactory closure.