I have this JSON data:
var people = [
{ name : "John", age : 25 },
{ name : "Jane", age : 49 },
{ name : "Jim", age : 31 },
{ name : "Julie", age : 39 },
{ name : "Joe", age : 19 },
{ name : "Jack", age : 48 }
];
How can I loop through all the objects inside people and output their names along with their ages like so:
John 25
Jame 49
followed by the rest...
Use a for loop: http://www.w3schools.com/js/js_loop_for.asp
or the
eachfunction in jQuery: http://api.jquery.com/jQuery.each/