In the majority of O. Henry's short stories, irony is used to produce a very strong ending that shocks the reader, and also the characters contained in his stories, into seeing the world in a different way or challenging their beliefs. Note how this is achieved in "The Gift of the Magi," where the loving couple sacrifice their most precious possessions to buy a gift for the other, rendering the gifts unusable. Yet, in spite of the irony of this situation, the narrator at the end insists that this willingness to sacrifice what is most precious to them earns them a special title and remembrance:
But in a last word to the wise of these days let it be said that of all who give gifts these two were the wisest. Of all who give and receive gifts, such as they are wisest. Everywhere they are wisest. They are the magi.
This challenges the perspective of the reader who may otherwise dismiss Jim and Della's generosity as foolishness. Note how the same challenging perspective is present in "What You Want..." where the value of money is again challenged through the contentment of James Taylor achieving a moment of bliss and calm, even though he is in prison. So calm is he that he refuses to be bailed because he has what he wants, and thus O. Henry challenges the belief that money is necessary and will buy you happiness.