0
I created an array:
var tagListArray = [];
for(i = 0; i<resultados.item(i); i++){
tagListArray = ["valor1", "valor2"];
}
console.log(tagListArray);
That one resultados.item(i)
me returns x values, how do I add to the array?
I did so to test:
var tagListArray = ["Maçã", "Banana"];
var data = new Object({data:[]});
var index;
for(index = 0; index < results.rows.length; index++) {
alert(results.rows.item(index).descricao);
data.data.push({
tag: tagListArray[index]
});
};
But, in tagListArray I want the values to be filled with what the repetition loop returns.
resultados.item(i)
is an array? What is the structure?– Sam
@Sam is not an array.
– user130604
You have to see how it is returned to know how to make the loop.
– Sam
results.item(i) has the values a and b. if I give console.log when the is over it returns me ab.
– user130604
You have to inform how this return is, if it is a string, an object... array vc has already said it is not.
– Sam
It’s a string...
– user130604
I really could not understand what you want. Good luck!
– Sam