troubleshooting Question

es6 javascript string interpolation - array within array

Avatar of mikha
mikhaFlag for United States of America asked on
2 Comments1 Solution38 ViewsLast Modified:
I have a json array that i get back from a ajax call. I loop over the data and append it to HTML , this works fine. Now I want to add the list of siblings as a list , which is an array

I have used string interpolation below with es6, how can i iterate through the list of siblings below, any suggestions?

     $.each(this.results, (index, item) => {
       let newitem = documment.createElement('div');

       newItem.innerHTML = `<div>
                                             </div>`  ;

       this.listcontainer.append ( newItem)


  "results" : [
                           name : "adam" , 
                           family : {
                                               siblings: [
                                                                    {"relation" : "sister" , "name":"jennifer"},
                                                                    {"relation" : "brother" , "name":"john"}
                                               mother : "janet",
                                               father : "thomas"
                           name : "johnathon" , 
                           family : {
                                               siblings: [
                                                                    {"relation" : "brother" , "name":"scott"},
                                                                    {"relation" : "brother" , "name":"chuck"}
                                               mother : "debby",
                                               father : "shawn"


Open in new window

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros