Upon receiving a list of objects from the front end as:
item=["false","true"]
I proceed to check a column within my records to identify values containing "true" or "false" using the following code:
this.records.filter(x=> items.includes(x.column))
Unfortunately, my records always seem to be empty.
If I manually set it like
this.records.filter(x=> x.column == false)
, it works fine.
However, relying on includes() is important since users can select both true and false options. Hard coding won't work because we don't know in advance what the user will choose.
Is there a way to convert the string ["true","false"] into [true,false]?
I've attempted declaring items as:
public items:boolean[]=[];
Yet, no success so far.