This is my first question in stackoverflow, So any kind of help is appreciated.
I have an array like this
var products = [{status:'available', ...},{status:'none', ...},{status:'available', ...},{status:'', ...},{status:'none', ...}]
how can I get an array that contains only products[i].status = 'available' .
I already did this with for loop but isn't there a better method? My code is practically full of loops now & it's not easy to read.
Thank you for you help.
filter()function,var res = products.filter(v => v.status == 'available')filter: developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/…