Visa Inc. interview question

difference between tab.foreach() and tab.map() and give me an example