What is wrong here

Tell us what’s happening:

Your code so far


let username = "JackOfAllTrades";
let userCheck = /\D[A-Za-z]*?/ig; // Change this line
let result = userCheck.test(username);
console.log(result);  

///^[A-Za-z\D]+\d$/ig

why last three is wrong?

first remove the g flag, then try again. Do not use g flag with test method.

when I remove [g] flag , he give me more error?

he still give error