Tell us what’s happening:
It works anyway
**Your code so far**
function confirmEnding(str, target) {
let myRegex = new RegExp(target + "$");
return myRegex.test(str);
}
confirmEnding("Bastian", "n");
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36 Edg/89.0.774.63
.
Challenge: Confirm the Ending
Link to the challenge: