Tell us what’s happening:
everything is fine but the last task say that have to be at least two characters and if it just two characters it should be an alphabet.
anyone help me in this part ?
Your code so far
let username = "J";
let userCheck = /^[a-zA-z][a-zA-Z]\d|\D$/g; // Change this line
let result = userCheck.test(username);
console.log(result)
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:82.0) Gecko/20100101 Firefox/82.0.
Actually, modifying that line doesn’t matter. That username setup is mainly for our testing purposes and we can change the value freely to test different cases. If you do, it wouldn’t mess up when the challenge is being graded since it will supplies its own test cases.
For this problem, that’s true but a lot of people post to the forum asking why their code doesn’t work and they accidentally changed other lines of code they weren’t supposed to.
In my opinion, it’s just good practice to only change the lines that are supposed to be changed. It would suck to bang your head against the wall wondering why the test wouldn’t pass all because you altered a line that you didn’t have to.