l have following data json keys objects
{
"23ac54a": [
25.226,
54.9333
],
"23ad09a": [
24.9228,
55.1319
],
"23ad1b6": [
24.8367,
55.148
]
}
l am trying to pass parameter from page 1 to page 2 . So if that parameter is same value in that data json above i want to get only data under that object key depending on same parameter coming from page 1 .
example if parameter from page 1 is 23ad09a and he is same in that data json i will take only data under this 23ad09a from data json above .
So my question is its possible to do that using if statement ? and if its how can i write functionality depending on my code below please ?
My code
this.Data = JSON.parse(data.data);
console.log(this.Data)
this.points = Object.keys(this.Data)
.map(key => this.Data[key])
.map((position) => ({
lat: position[1],
lng: position[2],
})).filter(position => position.lat && position.lng).forEach(i => {
console.log(i.lat, i.lng)
// our work is here
})