1

I have a list of objects that gets returned from the font end as

item=["false","true"]

i take these items to check a column from my records to see which values contain true or false as follows

this.records.filter(x=> items.includes(x.column))

but my records are always returning empty.

if i hard code it as example this.records.filter(x=> x.column == false) it works.

But i am using includes() because a user can select both true or false options and i cant go hard code it cause i wont know what the user might select.

how do i convert the string ["true","false"] into [true,false]?

i tried declaring items as

public items:boolean[]=[];

but still no luck

1 Answer 1

1

You can convert it using items.map(item => item === "true")

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.