Review my solution for Missing letters challenge

Review my solution for Missing letters challenge
0

#1

function fearNotLetter(str) {
var arr=[];
var result;
for (var i=0;i<str.length;i++){
uni = str.charCodeAt(i);
arr.push(uni);

}

for (var j=1;j<arr.length;j++){
if (arr[j]-arr[j-1] != 1){
result = arr[j]-1;
console.log(result);
return String.fromCharCode(result);
}

}
return undefined;
}

fearNotLetter(“abcdefghjklmno”);

What do you think? What is the best solution for you?


#3

That’s definitely more concise and more elegant solution, thanks!