let words = [
'/me', '/do', '/try'
];
let resMessage = '/do'
let exitElement;
for (let i = 0; i < words.length; i++) {
if (resMessage.indexOf(words[i]) !== -1) {
let kol = resMessage.indexOf(words[i])
exitElement = words[kol]
}
}
alert(exitElement)