What was the hanging gardens of Babylon used for?

The hanging gardens of Babylon are believed to be one of the seven wonders of the world. It is believed that the hanging gardens of Babylon were built because Nebuchadnezzar II wanted to cheer up his wife after she had to leave an area filled with green grass and hillsides.