Hello world, pls i want a user to login unless the password the user want to login with is equal to the length of string if not the user cant login in

function myLogin(){
  let userName = prompt("Username");
  let password = prompt("Password");
  let userPass ="number" ;

  if( password === userPass.length){
    login = "Welcome to club";
  }else{
    login = "Sorry! input right fig";
  }
  document.getElementById('demo').innerHTML= login;
}

so what exactly is the problem?

Hello there,

I am not sure what you want to achieve, but did you mean this:
password.length === userPass.length

i want the correct code

the code provide logic error

pls help me make correction to the code

why don’t you try password.length === str .length and notify me if it works?

I am not sure what you are trying to accomplish. Your code is doing exactly this:

Hello world, pls i want a user to login unless the password the user want to login with is equal to the length of string if not the user cant login in

what does the str mean pls

the topic is a little bit… vague

but pls can u write me a new code!

str is the String so str.length is the length of the string

ohk i understand :sweat_smile:

While we are primarily here to help people with their Free Code Camp progress, we are open to people on other paths, too. Some of what you are asking is pretty trivial in the Free Code Camp context, so you might find that if you’re not getting the instruction and material you need in your current studies, the FCC curriculum will really help you get started. At a modest guess I’d say investing a 4-5 hours working through the curriculum here will really pay off. You can find the curriculum at https://www.freecodecamp.org/learn.

With your current questions, we don’t have enough context to know what you already know or don’t know, so it is impossible to guide you without just telling you the answer (which we won’t do).

Happy coding :slight_smile: