I have a Vue.js
web app that consumes data from an express.js
API and shows the response array in a table. Each object of the array has unique id formed by Name_Version
(for example P.90.001000-0004_2
). The problem is that I need to show only the last version of each one. For example, if the API response is:
[{id: P.90.001000-0004_1}, {id: P.90.001000-0004_2}, {id: P.90.001000-0004_3}, {id: P.90.002222-0025_1}, {id: P.90.002222-0025_2}]
the result array to show in the table would be:
[{id: P.90.001000-0004_3}, {id: P.90.002222-0025_2}]
It's been impossible for me to achieve this result, can anyone please help me?