Skip to content

Instantly share code, notes, and snippets.

@supernovaplus
Created May 24, 2022 16:10
Show Gist options
  • Save supernovaplus/ffe590d8514d16de2d0cefc22f73644f to your computer and use it in GitHub Desktop.
Save supernovaplus/ffe590d8514d16de2d0cefc22f73644f to your computer and use it in GitHub Desktop.
;(async () => {
const stringToFind = 'hello WORLD';
let result = '';
for (let i = 0; i < stringToFind.length; i++) {
for (let j = 32; j < 127; j++) {
await new Promise(resolve => setTimeout(resolve, 10));
console.log(result + String.fromCharCode(j));
if(stringToFind.charCodeAt(i) === j){
result += stringToFind.charAt(i);
break;
}
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment