E
E
Egor Fazara2021-02-16 21:41:04
Node.js
Egor Fazara, 2021-02-16 21:41:04

Why does logs.push not a function give an error?

Gives the following error: Handle polling update error: TypeError: logs.push is not a function
Command:

cmd.hear(/^(?:np)\s([^]+)$/i, async (message, bot) => {
    logs.push({
    idlog: message.user.uid,
    logs: message.args[1]
  })
});

VK-IO version: [email protected]
What to do, how to fix it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey, 2021-02-17
@slide13

logs contains a json object, and you insert data into it, as in an array

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question