score:1

Accepted answer
if (payload[key]) {
 if (payload[key] instanceof Array) {
    var idx = payload[key].indexOf(value);
  if (idx > -1) payload[key].splice(idx, 1);
 } else {
    delete payload[key];
 }
}

Related Query

More Query from same tag