I’m trying to figure out why my code isnt wokring, can anyone help me figure out why? I’m trying to use the regular expression to get the end of the submitted string and then use an if statement to return true or false.
Your code so far
function confirmEnding(str, target) {
let stringEnding = /str$/
return target = stringEnding ? true : false ;
}
confirmEnding("Bastian", "n");
Your browser information:
User Agent is: Mozilla/5.0 (X11; CrOS x86_64 11316.148.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.117 Safari/537.36
.
Link to the challenge: