Tell us what’s happening:
I have passed all other steps, but step 2 - “confirmEnding should take 2 parameters”.
Can anyone help? Is it me or is it something with the lab? I have looked at other examples and they have the parameters laid out the same as me.
Thank you ![]()
Your code so far
function confirmEnding(string1,string2) {
return string1.slice(-string2.length) == string2;
}
let string1 = "Bastian";
let string2 = "n";
let result = confirmEnding(string1, string2);
console.log(result);
string1 = "Congratulation";
string2 = "on";
console.log(confirmEnding(string1, string2));
string1 = "Connor";
string2 = "n";
console.log(confirmEnding(string1, string2));
string1 = "Walking on water and developing software from a specification are easy if both are frozen";
string2 = "specification";
console.log(confirmEnding(string1, string2));
string1 = "He has to give me a new name";
string2 = "name";
console.log(confirmEnding(string1, string2));
string1 ="Open sesame";
string2 ="same";
console.log(confirmEnding(string1, string2));
string1 = "Open sesame";
string2 = "sage";
console.log(confirmEnding(string1, string2));
string1 = "Open sesame";
string2 = "game";
console.log(confirmEnding(string1, string2));
string1 = "If you want to save our world, you must hurry. We don't know how much longer we can withstand the nothing";
string2 = "mountain";
console.log(confirmEnding(string1, string2));
string1 = "Abstraction";
string2 = "action";
console.log(confirmEnding(string1, string2));
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36
Challenge Information:
Build a Confirm the Ending Tool - Build a Confirm the Ending Tool