Array.filter not handling blank values [closed]

  filter, javascript, reactjs

I have an array which consists of blank data for one property and when All is selected, it returns 0 values in table grid.

const ary = [
{name:'Katie',age:''},{ name:'Minnie',age:''}] 
Filterdata = ary.filter(a=>a[age])

But works if age has 1 blank character. How can I resolve this?

Source: Ask Javascript Questions

LEAVE A COMMENT