Nested Loop javascript

Simple nested loop javascript code var person = [{ name : [ {firstName: “Ravi”, lastName: “Kumar”} ], id : 5566 },{ name: [ {firstName: “John”, lastName: “Braman”} ], id : 96 }]; var item, text; text=”<table class=’stack’>”; text+=”<thead><tr><th>First Name</th><th>Last Name</th><th>id</th></tr>”; for(var i=0; i<person.length; i++) { for(var j=0; j<person[i].name.length; j++) { text += “<tr><td>”+person[i].name[j].firstName+”</td><td>”+person[i].name[j].lastName+”</td>”+”<td>”+person[i].id+”</td></tr>”; } } […]