freeCodeCamp Challenge Guide: Confirm the Ending

I got a similar code but used .substring instead of .substr

function confirmEnding(str, target) {
if (str.substring(str.length - target.length) === target) {
return true;
}
return false;
}

1 Like