Tell us what’s happening:
Hello everyone here.
Could anyone possibly tell me what went wrong here? Why can’t I use “else” to return false?
Many thanks!
Your code so far
function confirmEnding(str, target) {
if (target === str.substr(-target.length));{
return true;
}
else
return false;
}
confirmEnding("Bastian", "n");
Your browser information:
Your Browser User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.162 Safari/537.36
.
Link to the challenge:
https://www.freecodecamp.org/challenges/confirm-the-ending