I have a simple issue grouping conditionally.
const aInput = [
{"date":"2018/9/10", "code":"A"},
{"date":"2018/9/10", "code":"B"},
{"date":"2018/9/11", "code":"B"},
{"date":"2018/9/11", "code":"B"}];
I want to group the array by day & code BUT if there is both A & B for one day then only B stays
const aInput = [
{"date":"2018/9/10", "code":"A"},
{"date":"2018/9/10", "code":"B"},
{"date":"2018/9/11", "code":"B"},
{"date":"2018/9/11", "code":"B"}];
// I want to group the array above by day & code BUT if there is both A & B then only B stays
const aOutput = [
{"date":"2018/9/10", "code":"B"},
{"date":"2018/9/11", "code":"B"}]