Build a Confirm the Ending Tool - Build a Confirm the Ending Tool

Tell us what’s happening:

I tested all requests and works, but not sure why can’t pass from step 3, thanks.

Your code so far

function confirmEnding(words, check){

if(words.slice(- check.length) === check)
{
  return "true";
}

else
{ return "false";};


};

console.log(confirmEnding("Bastian","n"));

console.log(confirmEnding("Congratulation","on"));

console.log(confirmEnding("Connor","n"));

console.log(confirmEnding("Walking on water and developing software from a specification are easy if both are frozen", "specification"));

console.log(confirmEnding("He has to give me a new name","name"));

console.log(confirmEnding("Open sesame","same"));

console.log(confirmEnding("Open sesame","sage"));

console.log(confirmEnding("If you want to save our world, you must hurry. We don't know how much longer we can withstand the nothing","mountain"));

console.log(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/143.0.0.0 Safari/537.36 Edg/143.0.0.0

Challenge Information:

Build a Confirm the Ending Tool - Build a Confirm the Ending Tool

"true" and "false" are strings. confirmEnding should return Boolean: true or false.

got it, thanks alot.:+1:

code removed by moderator

hi @pak2601

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge. How to Help Someone with Their Code Using the Socratic Method

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.