Skip to content
Advertisement

Merge multiple outputs from multiple functions into one array in Javascript?

Example

I have these values, there is any way to put them together in a single array?

This is one of the functions that make the results, they take their data from a database.

JavaScript

Advertisement

Answer

Your problem is you put var voti = [] in the function that will initialize a new array every time you call it. If you want to push data to that array, you should move it out from voti(Voti) function

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement