Solution 1 can be simplified to:
function confirmEnding(str, target) {
return str.slice(-target.length) === target
}
If a negative number is provided as the first parameter to slice(), the offset is taken backwards from the end of the string.
Solution 1 can be simplified to:
function confirmEnding(str, target) {
return str.slice(-target.length) === target
}
If a negative number is provided as the first parameter to slice(), the offset is taken backwards from the end of the string.
Hello there.
Thank you, for your contribution. For future contributions, please wrap your solution within :
[details]
```
code goes here...
```
[/details]
Also, provide all of the necessary code to pass the challenge.
Thank you, for your guide post contribution. I have taken your suggestions and included them in the mentioned guide post.
We look forward to your further contribution.