filterElements = (elements, filter) => {
return elements = elements.filter((el) => {
return el.toLowerCase().match(filter.trim().toLowerCase());
});
}
['Томск', 'Омск']
filterElements = (elements, filter) => {
return elements = elements.filter((el) => {
return el.charAt(0).toLowerCase() === filter.trim().toLowerCase();
});
}
filterElements = (elements, filter) => {
return elements = elements.filter((el) => {
return el.toLowerCase().startsWith(filter.trim().toLowerCase());
});
}