Remove underscore from string

Run Settings
LanguageJavaScript
Language Version
Run Command
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("_"));
Editor Settings
Theme
Key bindings
Full width
Lines