I have an array of objects. In that array of objects I have to find which keys have empty value with index of array. Array list is given below:
let fruits=[
{name:"apple",quantity:2,price:"" },
{name:"orange",quantity:" ",price:"2"},
{name:"banana",quantity:" ",price:""}
];
so here i have to find any of object key having empty value which should return key with index. i have tried using .findIndex()
and other methods but unfortunately i can't. I am new to es6 and typescript. i need to check key with empty value in array of object.