Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

294
Views
I can't set a value to a array on JS - TypeError: Cannot convert undefined or null to object

When I run the code, works fine for the first time(array[0]). The problem isn't at the function MatFin.ativos.covariancia. Can somebody help me?

The error:

UnhandledPromiseRejectionWarning: TypeError: Cannot convert undefined or null to object

function matrizDeCovariancia(ativos) {
  i = 0
  var matrizResultado = new Array
  while (i < Object.keys(ativos).length) {
    matrizResultado[i] = new Array
    a = 0
    while (a < Object.keys(ativos).length) {
      matrizResultado[i][a] = MatFin.ativos.covariancia(ativos[i], ativos[a])
      a++
    }
    i++
  }
  return matrizResultado
}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!