커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
const condition = result.data.weather[0].main에서 data와 [0]는 왜있는 건가요?
[왕초보] 나만의 수익성 앱, 앱개발 종합반 v5
4주차
북마크
김*은
댓글
5
추천
0
조회수
5
조회수
5
답변 완료

1.아래와 같은 코드에서 data와 [0]의 역할은 뭔가요?

const temp = result.data.main.temp; 

const condition = result.data.weather[0].main


2.openweathermap 사이트 내 데이터는 아래와 같습니다.

 "weather": [


  {


   "id": 501,


   "main": "Rain",


   "description": "moderate rain",


   "icon": "10d"


  }


 ],


 "base": "stations",


 "main": {


  "temp": 298.48,


  "feels_like": 298.74,


  "temp_min": 297.56,


  "temp_max": 300.05,


  "pressure": 1015,


  "humidity": 64,


  "sea_level": 1015,


  "grnd_level": 933


 },

취소
 공유
취소
댓글 0
댓글 알림
나의얼굴