Hi there,
Is it possible to populate an empty array in a function node - in a way that it looks like:
{array: ["example1", "example2"]}
So far I only managed to do something like this:
var array=
var v1 = "";
var v2 = "";
if (msg.payload.average > 4) {
v1 = " average";
array.push({v1})
.. and so on, which creates an array with objects and new key value pairs, in this case v1: "average" and so on, instead of just a list of items/strings:
array: array[1]
0: object
v1: " average"
1: object
v2: " random"
Next step, I want to display it in html, for which I have a template node with mustache, but that gives me (with the object array) a list of - object Object.
What I have now is:
- {{#payload}}
- {{.}}
{{#array}}
{{/array}}
{{/payload}}
Any ideas?
Thank you