Not sure how do to this, so any help is greatly appreciated
Say I have :
const array1 = [1, 1, 2, 3, 4];
const array2 = [1, 2];
Desired
Not sure the most efficiency way to do this in modern JS, and I'm pretty old-school, so here's an old-school solution:
var array1 = [1, 1, 2, 3, 4];
var array2 = [1, 2];
// Note this method is destructive
Array.prototype.removeFirstValueMatch = function(ar)
{
var indexesToRemoveAr = [];
var indexesToRemoveOb = {};
for(var i=0, j; i