I am trying to filter the products that are only inStock: true, I do not know how to insert it on this code:
The products are showing even the inStock is false. Here is how my products look like:
>Solution :
If you want to filter the items depending on the value of inStock you should use .filter() like so:
products.filter(product => product.inStock === true)
Here product represents an element of products, which in your case is an object, and like any object you can access the properties inside using the dot accessor ‘.’

