-3
I have this code:
for(i=0; i<results.rows.length; i++){
$('.chips').material_chip({
data: [
{tag: results.rows.item(i).descricao},
]
});
}
results.rows.item(i).descricao
gives me some values..
how do I save all these values in for in a single variable?
EX: var exemplo = valor1, valor2...
Anyway, all the values he found in for
. It is possible?
Please do not duplicate your questions. If no one has answered previous, focus your efforts on it to make it clearer. For example, there left a comment with a suggestion, you even tried?
– hkotsubo
Yeah, it didn’t work
– user130414
Then the ideal would be edit the question explaining that you tried (putting the code) and what happened (if there was an error, what the message, etc., that is, being specific, because "it didn’t work" is a vague description). You may even get answers here, but posting the question again isn’t ideal (because it might be closed because it is duplicated). I suggest you do the [tour] and read the page [Ask] and the help center
– hkotsubo
Putting examples also helps: some values of what you have in this array, what should be the result and what happened when you ran your code. In other words, a [mcve] <-- read this link too, it will help you better understand how to improve your questions and increase the chances of an accurate answer.
– hkotsubo
You need to study on arrays, the colleague gave you a useful answer and you are discarding it due to ignorance of the operation of arrays and the method
push
. Look for some material (example) and study a little more.– fernandosavio