-Enigmos-

decrypter.js

Apr 11th, 2022
880
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function decrypter(input) {
  2.     let wordsArray = input;
  3.  
  4.     for (let word of wordsArray) {
  5.         let newWord = '';
  6.         for (let i = 0; i < word.length; i++) {
  7.             let code = word.charCodeAt(i);
  8.             code += 1;
  9.             newWord += String.fromCharCode(code);
  10.         }
  11.         console.log(newWord);
  12.     }
  13.  
  14. }
  15.  
  16. decrypter(['University', 'Potato', 'Putin', 'ABC']);
Advertisement
Add Comment
Please, Sign In to add comment