I am working on react native project.
I am getting response from server as follows.
[
{
"id": 58,
"year": 2000,
"value": "1450",
}, {
"id": 58,
"year": 2001,
"value": "1,980",
},
{
"id": 58,
"year": 2014,
"value": "600",
}, {
"id": 58,
"year": 2015,
"value": "200",
}, {
"id": 58,
"year": 2016,
"value": "180",
}, {
"id": 58,
"year": 2017,
"value": "145",
}, {
"id": 58,
"year": 2018,
"value": "1650",
}, {
"id": 58,
"year": 2019,
"value": "1444",
},
]
But, I have to take only last 5 years data only.
How to filter this in react native?