javascript array 반복문
javascript의 가장 많이 사용하는 array 반복문 3가지(for, for of, forEach)를 소개합니다. 1. 반복문 종류 - for문 - for of문 - forEach 1.1. forEach - 매개변수로 value, index, arrary를 사용할 수 있다. const arr = ['teemo', 'galio', 'yasuo']; arr.forEach((value, index, array) => { console.log(`value: ${value}, index: ${index}, array: ${array}`); }); // 출력 결과 // value: teemo, index: 0, array: teemo,galio,yasuo // value: galio, index: 1, arr..
2023. 1. 7.