Created
March 19, 2020 19:18
-
-
Save davidaurelio/4ebf7d9ee2031390078568c25157debc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fearNotLetter(str) { | |
let last = str.charCodeAt(0); | |
for (let i = 1; i < str.length; ++i) { | |
const code = str.charCodeAt(i); | |
if (code !== last + 1) return String.fromCharCode(last + 1); | |
last = code; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment