When working in JavaScript, I often find myself needing to filter a list of objects
let dataid = infosStructured.filter(elm => {
console.log(elm.identifiant);
console.log("matching value", elm.identifiant == this.dataService.getcurrentId()); // This condition is met
return elm.identifiant == this.dataService.getcurrentId();
});
console.log(dataid); // However, the result is empty
It's peculiar that even though
elm.identifiant == this.dataService.getcurrentId()
evaluates to true at some point, my dataid
remains empty