Ajax 요청 첫번째 강의를 보고 숙제를 하는데 처음에는 이렇게 풀었습니다.
axios.get('https://codingapple1.github.io/shop/data2.json')
.then((result)=>{
let copy = shoes;
result.data.foreach((item)=> {
copy.push(item);
})
setShoes(copy);
})
그러나 콘솔창에는 result.data가 foreach라는 function을 안가져서라고 뜹니다.
여기서 질문하고 싶은것은 console.log(result.data)를 하면 배열로 나오는데 왜 foreach를 쓸 수 없는지 모르겠습니다.