map함수

    [TIL] 2022년 01월 18일

    이번시간에 배운 내용은 React 7강 반복문을 대체할 여러가지 문법에 대해 배웠다. React 7강 나이제 for문 안써 => map함수/filter함수 최신 데이터를 가져와줘!! => refetch 목록에서 삭제가 안되는데... => key/index map vs filter map const classmates = ["철수", "영희", "훈이"] classmates.map((el) => (el + "어린이")) map함수를 사용해 classmates라는 값에 배열형태에 값이 선언되었을때는 map함수를 사용해 element를 사용해 index 뒷부분에 문자을 삽입할 수 있는 map 함수이다. const classmates = [ { name: "철수" }, { name: "영희" }, { name:..