Никак до меня не дойдет какими методами можно из вот такого массива:
const allActions = [
{TERBANK: 'AB', ORDER_NUMBER: 10, ACTION_NAME: 'В очередь', SERVICE: 'Наш сервис'},
{TERBANK: 'AB', ORDER_NUMBER: 11, ACTION_NAME: 'На себя', SERVICE: 'Наш сервис'},
{TERBANK: 'AB', ORDER_NUMBER: 21, ACTION_NAME: 'СБС', SERVICE: 'СБС1'},
{TERBANK: 'AB', ORDER_NUMBER: 22, ACTION_NAME: 'СБС', SERVICE: 'СБС2'},
{TERBANK: 'AB', ORDER_NUMBER: 23, ACTION_NAME: 'СБС', SERVICE: 'СБС3'},
{TERBANK: 'BB', ORDER_NUMBER: 10, ACTION_NAME: 'В очередь', SERVICE: 'Наш сервис'},
{TERBANK: 'BB', ORDER_NUMBER: 11, ACTION_NAME: 'На себя', SERVICE: 'Наш сервис'},
{TERBANK: 'BB', ORDER_NUMBER: 21, ACTION_NAME: 'СБС', SERVICE: 'СБС1'},
{TERBANK: 'BB', ORDER_NUMBER: 22, ACTION_NAME: 'СБС', SERVICE: 'СБС2'},
{TERBANK: 'BB', ORDER_NUMBER: 23, ACTION_NAME: 'СБС', SERVICE: 'СБС3'},
{TERBANK: 'CB', ORDER_NUMBER: 10, ACTION_NAME: 'В очередь', SERVICE: 'Наш сервис'},
{TERBANK: 'CB', ORDER_NUMBER: 11, ACTION_NAME: 'На себя', SERVICE: 'Наш сервис'},
{TERBANK: 'CB', ORDER_NUMBER: 21, ACTION_NAME: 'СБС', SERVICE: 'СБС1'},
{TERBANK: 'CB', ORDER_NUMBER: 22, ACTION_NAME: 'СБС', SERVICE: 'СБС2'},
{TERBANK: 'CB', ORDER_NUMBER: 23, ACTION_NAME: 'СБС', SERVICE: 'СБС3'},
];
Делаю следующее:
const actinsAB = allActions.filter(function(tb) {
return tb.TERBANK == 'AB';
});
А как добавить условие, чтобы по ACTION_NAME отсеивались повторные элементы?
В общем, должен получиться вот такой массив:
const actinsAB = [
{TERBANK: 'AB', ORDER_NUMBER: 10, ACTION_NAME: 'В очередь', SERVICE: 'Наш сервис'},
{TERBANK: 'AB', ORDER_NUMBER: 11, ACTION_NAME: 'На себя', SERVICE: 'Наш сервис'},
{TERBANK: 'AB', ORDER_NUMBER: 21, ACTION_NAME: 'СБС', SERVICE: 'СБС1'},
];