Tell us what’s happening:
test error : 2) confirmEnding(“Congratulation”, “on”)` should return true.
any help please?
if i uses reduceRight is good idea?
Your code so far
function confirmEnding(str, target) {
let arr = str.split("");
return arr[arr.length-1]==target ;
}
confirmEnding("Bastian", "n");
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36
.
Challenge: Confirm the Ending
Link to the challenge: