JSFiddle - React, Tailwind, and code Playground

by aninaslyan

JavaScript

function chipher(coded) {
	let alphabet = "abcdefghijklmnopqrstuvwxyz";
  let str = "";
  
  for (let i=0; i<coded.length; i++) {
  	let index = alphabet.indexOf(coded[i]);
    
    for(let j=0;j<alphabet.length; j--) {
    	str += alphabet[j]	
    }			a
  }
   return coded;
}

text = prompt("Input text");
console.log(chipher(text));