forEach 구문 일반 for문 사용 const animals = ['호랑이', '사자', '사슴', '토끼', '거북이']; for (let i = 0; i < animals.length; i++) { console.log(animals[i]); } forEach 사용 const animals = ['호랑이', '사자', '사슴', '토끼', '거북이']; function print(animal) { console.log(animal); } animals.forEach(print); forEach 및 익명 함수 사용 const animals = ['호랑이', '사자', '사슴', '토끼', '거북이']; animals.forEach(function(animal) { console.log(animal); }); forEach 및 화살표 함수 사용 const animals = ['호랑이', '사자', '사슴', '토끼', '거북이']; animals.forEach(animal => ...
#array
#배열내장함수
#배열
#맵
#내장함수
#map
#javascriptmap
#javascript
#foreach
#자바스크립트
원문링크 : [Javascript] 배열 내장 함수 정리(forEach, map)