js array from json
weather data from mesowest.net
by grant
HTML
<div id="demo">
array from json js
</div>
JavaScript
const data = {
"UNITS": {
"precipitation": "Inches"
},
"STATION": [{
"STATUS": "ACTIVE",
"MNET_ID": "25",
"PERIOD_OF_RECORD": {
"start": "20000120",
"end": "20180121"
},
"ELEVATION": "6340",
"NAME": "BOGUS BASIN",
"RESTRICTED": false,
"STID": "BOGI1",
"ELEV_DEM": "6362",
"LONGITUDE": "-116.09685",
"STATE": "ID",
"OBSERVATIONS": {
"precipitation": [{
"count": 23,
"first_report": "20180115",
"interval": 1,
"report_type": "precip_accum",
"last_report": "20180115",
"total": 0.0
}, {
"count": 24,
"first_report": "20180116",
"interval": 2,
"report_type": "precip_accum",
"last_report": "20180116",
"total": 0.2
}, {
"count": 24,
"first_report": "20180117",
"interval": 3,
"report_type": "precip_accum",
"last_report": "20180117",
"total": 0.0
}, {
"count": 24,
"first_report": "20180118",
"interval": 4,
"report_type": "precip_accum",
"last_report": "20180118",
"total": 0.0
}, {
"count": 24,
"first_report": "20180119",
"interval": 5,
"report_type": "precip_accum",
"last_report": "20180119",
"total": 0.8
}, {
"count": 24,
"first_report": "20180120",
"interval": 6,
"report_type": "precip_accum",
"last_report": "20180120",
"total": 0.0
}, {
"count": 13,
"first_report": "20180121",
"interval": 7,
"report_type": "precip_accum",
"last_report": "20180121",
"total": 0.0
}]
},
"LATITUDE": "43.76377",
"TIMEZONE": "America\/Boise",
"ID": "1160"
}],
"SUMMARY": {
"DATA_QUERY_TIME": 1.6429424286,
"RESPONSE_CODE": 1,
"RESPONSE_MESSAGE": "OK",
"METADATA_RESPONSE_TIME": "0.0920295715332 ms",
...