What's the best way to remove the last element from an array if it matches a particular value?
For instance:
components = dedupeLast(components, '<app-builder-placeholder></app-builder-placeholder>');
function dedupeLast(a, target) {
for(let i = 0; i < a.length; i++){
if (i === a.length) {
if(a[i] === target)
a.splice(i, 1);
}
}
}