
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
날씨 온도 적용에 앞서 콘솔창에서 확인하려 하는데
코드를 보고 똑같이 따라했는데 콘솔창에 데이터를 불러오지 못하네요.
let url = "http://spartacodingclub.shop/sparta_api/weather/seoul"; -> url 이란 함수에 주소를 선언하고
fetch(url) -> 위에서 선언한 변수에 담겨있는 주소에 통신 요청 보냄
.then(res => res.json())
.then(data => {
let temp = data['temp']; -> temp라는 함수를 선언하고 'temp' 열에 있는 값을 불러온다.
console.log(temp);
})
let url = "http://spartacodingclub.shop/sparta_api/weather/seoul";
fetch(url)
.then(res => res.json())
.then(data => {
let temp = data['temp'];
console.log(temp);
})
