0
I need to get the data from the object.
$scope.salvarHabilidades = function(pro){
var valores = pro.filter(function(o,i){
return o.habilidades == true;
});
console.log(valores);
var dados = [];
for(var i = 0; i <= valores.length; i++){
dados.push(valores[i].idhabilidade);
}
}
You can’t understand what you want to do. You want to create an array of objects in a for?
– Jéf Bueno
Exactly! I have a javascript FOR and I want to mount an array object inside it
– GustavoSevero
Okay, Perai. You just edit the question saying you want to "catch" values. Please decide, I have written two different answers since I opened the post.
– Jéf Bueno
I want to mount an array object, inside the FOR, taking only the ids, got it? Look at my code, inside the FOR... On the console appears a message saying idhabilidade is undefined.
– GustavoSevero
If you had explained it in the question it would be much easier
– Jéf Bueno
Imagine how big the title would be if I put it all.
– GustavoSevero
That’s what it’s for the body of the question.
– Jéf Bueno