const word = "Poured Milk 2";
// console.log(word.indexOf("_"));
const reverseString = str => {
return str.split("").reverse().join("");
};
const reword = str => {
const reversedString = reverseString(str);
const indexOfLastUnderscore = reversedString.indexOf("_") + 1;
const subWord = reversedString.substring(indexOfLastUnderscore, str.length);
return reverseString(subWord);
}
console.log(reword(word));
console.log(word.includes("_"));