Tell us what’s happening:
Test Number 6 does not work. I know what the problem is but this is maximum capacity my brain works and how I can do this.
So , I need some help;;;
Your code so far
function confirmEnding(sentence, check){
let toCheck = sentence.includes(check);
const endSentence = sentence[sentence.length - 1];
const endCheck = check[check.length - 1];
if (toCheck == true && endSentence == endCheck){
console.log(true);
return true
} else {
console.log(false);
return false
}
}
confirmEnding("Congratulation", "on");
confirmEnding("Bastian", "n")
confirmEnding("Connor", "n")
confirmEnding("Walking on water and developing software from a specification are easy if both are frozen", "specification")
confirmEnding("He has to give me a new name", "name")
confirmEnding("Open sesame", "same")
confirmEnding("Open sesame", "sage")
confirmEnding("Open sesame", "game");
confirmEnding("If you want to save our world, you must hurry. We don't know how much longer we can withstand the nothing", "mountain");
confirmEnding("Abstraction", "action")
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36
Challenge Information:
Build a Confirm the Ending Tool - Build a Confirm the Ending Tool
https://www.freecodecamp.org/learn/full-stack-developer/lab-string-ending-checker/implement-a-string-ending-checker-function