Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript nested arrays stackoverflow

const results = [
    {
      id: 1,
      name: "sensor",
      children: [
        { id: 2, name: "sensor", parent: 1 },
        {
          id: 3,
          name: "sensor",
          parent: 1,
          children: [{ id: 4, name: "sensor", parent: 3 }]
        }
      ]
    },
    { id: 5, name: "sensor", children: [{ id: 6, name: "sensor", parent: 5 }] }
  ];
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #nested #arrays #stackoverflow
ADD COMMENT
Topic
Name
5+5 =