V
V
Vanya Mironov2021-03-26 16:27:31
Node.js
Vanya Mironov, 2021-03-26 16:27:31

(node:6580) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'length' of undefined?

Help I'm trying to setinterval and getting this error

(node:6580) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'length' of undefined


setInterval(async () => {
  for (a in users) {
    for(let i = 0; i < users[a].business.length; i++)
    {
      users[a].business[i].moneys += users[a].business[i].workers
    }
  }
}, 30000);

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question