Tell us what’s happening:
what’s wrong with this answer ?
Your code so far
function confirmEnding(str, target) {
if(str.test(/target$/)){
return true ;
}{
return false;
}
}
confirmEnding("Bastian", "n");
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36.
Challenge: Confirm the Ending
Link to the challenge: