Find the correct word by incrementing chart code of letters
Write a function that takes a string as argument and it might not have any meaning. Increment the char code of each letter and find a meaningful word.
// Return the correct word
function nextChar(c) { return String.fromCharCode(c.charCodeAt(0) + 1); } const correctWord = (str) => { let word = ''; for(let i =0; i < str.length ; i++) { word += nextChar(str[i]); } return word; }; const input = "bnchmf"; console.log(input); console.log(correctWord(input)); // coding