skip to Main Content

Add up JSON strings to one variable | JavaScript

I have been trying to figure out how to merge several JSON strings into one. My method is this: if (observations[31]) { // Ignore this. document.getElementById("ajaxrainmo").textContent = observations[31].imperial.precipTotal + observations[30].imperial.precipTotal + observations[29].imperial.precipTotal + observations[28].imperial.precipTotal + observations[27].imperial.precipTotal + observations[26].imperial.precipTotal + observations[25].imperial.precipTotal…

VIEW QUESTION
Back To Top
Search