I need to make two loops from one data point to create multiple divs.
Data Example:
let data = [
[
{
title: '1'
},
{
title: '2'
}
],
[
{
title: '3'
},
{
title: '4'
}
]
];
If I loop in here, I get 2 arrays with 2 sets of obj each.
I need to append a parent div for each array and inside the appended div, loop again to append the information from the obj.
To look something like this:
<div class="first-array"> //Class is just for reference
<span>
<p>title</p>
</span>
<span>
<p>title</p>
</span>
</div>
<div class="second-array"> //Class is just for reference
<span>
<p>title</p>
</span>
<span>
<p>title</p>
</span>
</div>
How can I be able to achieve this?
<p>title</p>or<p>1</p>,<p>2</p>, etc? Also,<p>should not be within<span>divelements. The inner loop processes the inner arrays and creats thespanandtitleelements.