Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function confirmEnding(str, target) {
- if (str.replace(str.substring(0, str.length-target.length),"") === target) {
- return true;
- } else {
- return false;
- }
- }
- confirmEnding("Bastian", "n");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement