Advertisement
Spocoman

03. Characters in Range

Jan 28th, 2022
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function solve (firstChar, secondChar) {
  2.  
  3.     let charSort = [firstChar, secondChar].sort();
  4.  
  5.     function charArray() {
  6.         let result = '';
  7.         for (let i = charSort[0].charCodeAt(0) + 1; i < charSort[1].charCodeAt(0); i++) {
  8.             result += String.fromCharCode(i) + ' ';
  9.         }
  10.         return result.trimEnd();
  11.     }
  12.  
  13.     console.log(charArray());
  14. }
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement