
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
2주차 수업 내용을 바탕으로 forEach를 활용해서 데이터를 console.log에 먼저 띄워보려고 하는데
console에 다음과 같이 TypeError : Cannot read properties of undefined (reading 'forEach') 라고 뜹니다.
어떻게 해야 해결을 할 수 있을까요?


작성한 코드 및 에러 메세지
$(document).ready(function () {
function drawContent(){
fetch("http://spartacodingclub.shop/sparta_api/weather/seoul").then(res => res.json()).then(data => {
let number = data['temp'];
number.temp.forEach((a) => {
let weather = a['temp']
});
})
}
drawContent();
})
