
2주차 숙제 중 방법을 2가지 찾았습니다. 2가지 방법 모두 정상적으로 출력은 되는데, 차이가 뭔지 모르겠습니다.
1번
$(document).ready(function () {
fetch("http://spartacodingclub.shop/sparta_api/weather/seoul").then(res => res.json()).then(data => {
let number = data['temp']
$('#temp').text(number)
})
})
2번
$(document).ready(function () {
fetch("http://spartacodingclub.shop/sparta_api/weather/seoul").then(res => res.json()).then(data => {
let temp_html = `${data['temp']}`
$('#temp').text(temp_html)
})
})
