Tell us what’s happening:
Describe your issue in detail here.
what am i missing here?
**Your code so far**
function confirmEnding(str, target) {
let string = str.split("")
for (let i = 0; i <= string.length; i++){
if (string[i] === target){
return true
} return false
}
}
console.log(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/101.0.4951.41 Safari/537.36 Edg/101.0.1210.32
Challenge: Confirm the Ending
Link to the challenge: