Tengo un arreglo ["a", "b", "c", "d", "e", "f"] y también un subarray ["a", "b", "c"] . Ahora el siguiente elemento en el arreglo principal al subarray es d . Entonces quiero obtener la matriz como ["a", "b", "c", "d"] .
Sé que hay muchas maneras de conseguir esto. Me gusta
get length of subarray => 3 slice from main array `length of subarray + 1` => _.slice(main_array, 0, 4) ¿Hay alguna otra forma elegante de hacer esto? Preferiblemente estoy buscando una solución usando lodash .