O. Henry is well known for his surprise endings, and "The Gift of the Magi" is no exception. Though Jim and Delia are poor by material standards, they are rich in their love for one another. There is no doubt that either of them would do whatever they could to make the other happy. The surprise comes when Delia cuts her hair, her most valued asset, to buy a chain for Jim's watch which he no longer owns because he sold it to buy combs for Delia's hair. This unexpected turn of events underscores the selflessness of their love.
Another literary element used by the author is allusion, a reference to a well-known person, place, event, or piece of literature. The title is a Biblical allusion to the magi, the three wise men who travelled a great distance on the night of Christ's birth to give Him the gifts of gold, frankincense, and myrrh. In this allusion, Jim and Delia represent the three wise men, giving each other the gift of love, even though their presents no longer had any use.