(need help with) Confirm the Ending

Tell us what’s happening:
am having a problem with only 2 of the tests to finish the challenge I can’t figure out a way to specifically target the last letters with my target parameter.
PLEASE DONT GIVE ME THE SOLUTION just direct me into it

Your code so far

function confirmEnding(str, target) {
    let reg = RegExp(target);
    let result = str.match(reg);
    
        if (result) {
            return true;
        }return false;
    
}

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/96.0.4664.110 Safari/537.36

Challenge: Confirm the Ending

Link to the challenge:

Can you explain what you think your code is doing?

You can directly compare strings by the way:

console.log("cat" === "cat");
1 Like

sry man i forgot to remove a part from the code I will edit it right away