I try to print all the values ββin the JSON list with for
each, and each time this mysterious undefined variable appears. Take a look:
HTML:
<span id="1"> </span>
JavaScript:
var lel = { 1: { "some": "json", "list": "that", "says": "undefined", }, } var s; for(i in lel[1]) { s+= '<B>' + i + '</B>' + ": " + lel[1][i] + "<br />"; } document.getElementById('1').innerHTML = s;
Result (in range)
undefined**some**: json **list**: that **says**: undefined
Where is this thing <undefined "?
source share