JSFiddle - React, Tailwind, and code Playground
by JamesD
JavaScript
var array = [
"Stories",
"Tasks",
"In Progress",
"In Review",
"Completed",
[
{
"divName": "content-container2",
"content": "us 2345",
"topPos": 109,
"leftPos": 150
},
{
"divName": "content-container3",
"content": "Description",
"topPos": 98,
"leftPos": 382
},
{
"divName": "content-container4",
"content": "12212",
"topPos": 110,
"leftPos": 644
}
]
], // This is your array
result = []; // This is the result array
// Loop through each index within our array
for (var i = 0; i < array.length; i++)
/* If the value held at the current index ISN'T an array
* add it to our result array. */
if (!(array[i] instanceof Array))
result.push(array[i]);
// Log the result array
console.log(result);