HomeAboutMeBlogGuest
© 2025 Sejin Cha. All rights reserved.
Built with Next.js, deployed on Vercel
🌳
말하면서 배워요 스터디
/
📁
자료 모음
/
🗣️
[탬플릿 for 말하면서배워요] 면접 질문 리스트
/
Can you describe the main difference between a forEach loop and a .map() loop and why you would pick one versus the other?

Can you describe the main difference between a forEach loop and a .map() loop and why you would pick one versus the other?

보충필요
답변
forEach는 불변성 지키지않음 : 리턴값이 없고, 해당 배열을 순회하며 작업진행 map은 불변성지킴 :순회 이후 작업이 진행된 새로운 배열을 리턴
중요도
2
reference link
질문번호
20
스스로점수
4