Сообщество IT-специалистов
Ответы на любые вопросы об IT
Профессиональное развитие в IT
Удаленная работа для IT-специалистов
localStorage.getItem('from').includes('car') || localStorage.getItem('from').includes('train') || localStorage.getItem('to').includes('car') || localStorage.getItem('to').includes('train')
const from = localStorage.getItem('from'), to = localStorage.getItem('to'); from.match(/car|train/) || to.match(/car|train/)
`${localStorage.getItem('from')} ${localStorage.getItem('to')}`.match(/car|train/);
function a(b,c) {return localStorage.getItem(b).includes(c)} a('from', 'car') || a('from', 'train') || a('to', 'car') || a('to', 'train')