daily pastebin goal
53%
SHARE
TWEET

Untitled

a guest Feb 19th, 2019 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function charInRange(startChar, endChar){
  2.     let start = startChar.charCodeAt(0);
  3.     let end = endChar.charCodeAt(0);
  4.     let charsInRange = [];
  5.  
  6.     if (end < start) {
  7.         let temp = start;
  8.         start = end;
  9.         end = temp;
  10.     }
  11.  
  12.     for (let i = start+1; i < end; i++) {
  13.         charsInRange.push(String.fromCharCode(i));
  14.     }
  15.     console.log(charsInRange.join(" "));
  16.    
  17. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top