[Vuejs]-Filter proprites from array of objects

3👍

const arr = [ { "total_spent": [ "greater_than", "less_than", "equal_to", "between" ] }, { "cart_value": [ "greater_than", "less_than", "equal_to", "between" ] }, { "shipping_price": [ "greater_than", "less_than", "equal_to", "between" ] }, { "product": [ "in" ] }, { "customer_type": [ "equal_to" ] } ]

console.log(arr.filter(x=> !!x.total_spent || !!x.product))

Leave a comment