I have an array in which I am tryingg to iterate to get ALL indexes when a true value is found for a key
sheet.headings = [
{
"label": "SheetId",
"access": "R",
"hidden": true,
"position": "left",
"input_type": "text"
},
{
"label": "Moteur Affichage",
"access": "W",
"hidden": false,
"position": "left",
"input_type": "text",
"value_type": "text"
},
{
"label": "Navigateur",
"access": "W",
"hidden": true,
"position": "left",
"input_type": "text",
"value_type": "text"
}
]
I can only get the first index, not all of the ( I should get [0,2]
var column_hidden = _.findIndex(sheet.headings, function(col) {
return col.hidden === true ;
});