Olá, não consigo indentificar o erro:
#
Fatal error in , line 0
Fatal JavaScript invalid size error 169220804
# # #
#FailureMessage Object: 00000062FAD5E330 1: 00007FF727CF7B7F v8::internal::CodeObjectRegistry::~CodeObjectRegistry+114079 2: 00007FF727C125AF std::basic_ostream<char,std::char_traits >::operator<<+65023 3: 00007FF7288F2772 V8_Fatal+162 4: 00007FF7284765C5 v8::internal::FactoryBasev8::internal::Factory::NewFixedArray+101 5: 00007FF72831FB83 v8::internal::FeedbackNexus::ic_state+62771 6: 00007FF7283366E0 v8::debug::Script::GetIsolate+15840 7: 00007FF7281AA231 v8::internal::CompilationCache::IsEnabledScriptAndEval+26913 8: 00007FF728648F91 v8::internal::SetupIsolateDelegate::SetupHeap+494417 9: 000001720CD89669
const { edFolha, edGalho } = require("./arrays.js")
function juntaListas(lista1, lista2) {
let posAtual1 = 0
let listaFinal = []
let posAtual2 = 0
let atual = 0
while(posAtual1 < lista1.length &&
posAtual2 < lista2.length ){
let prodAtual1 = lista1[posAtual1]
let prodAtual2 = lista2[posAtual2]
if(prodAtual1.preco < prodAtual2.preco){
listaFinal[atual] = prodAtual1
prodAtual2++
}else {
listaFinal[atual] = prodAtual2
prodAtual1++
}
atual++
}
return listaFinal
}
console.log(juntaListas(edGalho, edFolha));