function end(str, target) { return str.slice(-target.length) == target; } end("Bastian", "n");
console.assert(end("John", "n") === true);