Skip to content

Instantly share code, notes, and snippets.

@davidaurelio
Created March 19, 2020 19:18
Show Gist options
  • Save davidaurelio/4ebf7d9ee2031390078568c25157debc to your computer and use it in GitHub Desktop.
Save davidaurelio/4ebf7d9ee2031390078568c25157debc to your computer and use it in GitHub Desktop.
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