I need to understand if when I have a first element from the first object in the first array.
The structure is this:
let arr = [[{"a": 1, "b": 2}], [{"c": 3, "d": 4}]]
I've done this (see below), but maybe there is shorter solution
let arr = [[{"a": 1, "b": 2}], [{"c": 3, "d": 4}]]
let newArr = [];
//arr[0] - the first array
arr[0].map((item, index) => {
//pushing items into empty arr to get the first value
for (let key in item) {
newArr.push(item[key]);
}
console.log(newArr[0]);
});
I need the output like: - the first value of the firts object of the first array. - then other values.