Find and return the first instance of a non-repeating character in a string s

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?

I’ve edited your post for readability. When you enter a code block into the forum, remember to precede it with a line of three backticks and follow it with a line of three backticks to make easier to read. See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.

markdown_Forums

I see a few possible problems, but it’s hard to tell which one is causing your current error without you telling us what it is.