Could anyone here help me by show what is error in this code?
function firstNotRepeatingCharacter(s) {
for (let i = 0; i < s.length; i++) {
let repeat = 0;
for (let j = 0; i < s.length; j++) {
if( i!= j && s[i] == s[j]){
repeat =1;
break ;
}
}
if (repeat == 0) {
return s[i];
}
}
return '';
}
Could anyone here help me by showing what error is in this code below?