Is there an easy way to shorten this code block:
this.markersDisplay = this.markersSource;
// Filter Marker Type
if (this.isValid(this.selectedMarkersType)) {
let markers: Array<Marker> = new Array<Marker>();
for (let marker of this.markersDisplay) {
for (let markerType of this.selectedMarkersType) {
if (marker.MarkerType == markerType) {
markers.push(marker);
break;
}
}
}
this.markersDisplay = markers;
}
I want to find a more concise way to replace the double for loop with a lambda expression