Replace With Alphabet Position

Run Settings
LanguageJavaScript
Language Version
Run Command
function rt(str) { let num = [] const alp = Array.from({length:26}, (v,n) => String.fromCharCode(n+97)) // console.log(typeof(str)) for (let arr of str) { // console.log(alp.includes(arr)) // console.log(typeof(arr)); if (alp.includes(arr)) { // console.log(typeof(arr)) // console.log(this.arr) for (let arrw of arr) { let bol = alp.findIndex( rr => rr === arrw); num.push(bol) } } } return num.join(""); } console.log(rt(' ')) // const ao = "abc" // for (let ar of ao) { // console.log(ar) // }
Editor Settings
Theme
Key bindings
Full width
Lines