Different.
foreach iterates over a list and applies some operation with side effects to each list member (such as saving each one to the database for example)
map iterates over a list, transforms each member of that list, and returns another list of the same size with the transformed members (such as converting a list of strings to uppercase)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…