var obj = {
key1: "value1",
key2: "value1",
key3: "value2",
key4: "value3"
}
var obj = {
key3: "value2",
key4: "value3"
}
const valueToDel = 'value1';
for (const n of Object.entries(obj)) {
if (n[1] === valueToDel) {
delete obj[n[0]];
}
}
const newObj = Object
.entries(obj)
.reduce((acc, [ k, v ]) => (v !== valueToDel && (acc[k] = v), acc), {});
// или
const newObj = Object.fromEntries(Object
.entries(obj)
.filter(n => n[1] !== valueToDel)
);