How get the object by filtering key value inside the object? I have objects below where I need to only pull data which has session_id:23
data = [{ name: "fist Name", session_id : "23", login: "date" }, { name: "Second Name", session_id : "18", login: "date" }, { name: "Third Name", session_id : "23", login: "date" }];
I tried Angular Filter and Map method to filter this out but dosent seem to work for me here.
.pipe(
map((res) => {
res => res.filter(res => res.season_id == 23)
console.log(res);
})
)
ngOnInit() {
this._service.getData();
this._service.updatedPlayer
.pipe(
map((res) => {
res => ress.filter(res => res.season_id == 23)
console.log(res);
})
)
.subscribe(
(playerSession) => {
this.playerSessionUpdate = playerSession;
}
)
}