[Vuejs]-How to get specific elements(array) of array using filter in VueJS?

0👍

the below code will return you 2 works as you wished for.

let filteredArrayOfObjects = this.works.filter(function (item) {
          return item.sort === '2019';
        });
console.log("You will get two objects returned here" + filteredArrayOfObjects)

and here it is filtering array of objects based on condition, not array of array.

Leave a comment