맵 메서드는 배열 내의 모든 요소 각각에 대하여 주어진 함수를 호출한 결과를 모아 새로운 배열을 반환합니다.
arr.map(callback(currentValue[, index[, array]])[, thisArg])
callback: 새로운 배열 요소를 생성하는 함수(다음 세 가지 인수를 가진다)
1) currentValue: 처리할 현재 요소
2) index(optional): 처리할 현재 요소의 인덱스
3) array(optional): map()을 호출한 배열
thisArg(optional): callback을 실행할 때 this로 사용되는 값
const lastname = ["신","김","최","박","우","은","손"] console.log(lastname) //expected output : ["신", "김", "최", "박", "우", "은", "손"] const id = lastname.map(a => a+"길동"); console.log(id) //expected output : ["신길동", "김길동", "최길동", "박길동", "우길동", "은길동", "손길동"]