Tengo una matriz de matrices que tengo que convertir en una matriz de objetos:
[ [ { lable: "text", anotherValue: "anothervalue" } ], [ { lable: "text", anotherValue: "anothervalue" } ] ]
Necesito convertir esto en:
[ { lable: "text", anotherValue: "another value" }, { lable: "text", anotherValue: "another value" } ]
Puedes hacerlo usando el mapa. La función asignada a map como parámetro desempaqueta cada subarreglo y lo reemplaza por el objeto dentro.
a = [ [{lable:'text',anotherValue:'anothervalue'}], [{lable:'text',anotherValue:'anothervalue'}] ]; result = a.map((o) => o[0])