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

Tell us what’s happening:

Hi
My code is returning the correct answers but the lab will not pass.
What am I doing wrong?
TIA

Your code so far

const confirmEnding = (str1,str2) => {
  let num = str2.length
  let check = str1.slice(-num)
  console.log(check===str2);
}

confirmEnding("Bastian","n");
confirmEnding("Congratulation", "on");
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", "sage");

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

Hi @l3x1 and welcome to our community!

Your function has a console.log() but where is the return statement?

Thank you.

I keep using console.log instead of return.

1 Like