How can I check if a string ends with a particular character in JavaScript?
Example: I have a string
var str = \"mystring#\";
I wa
After all those long tally of answers, i found this piece of code simple and easy to understand!
function end(str, target) { return str.substr(-target.length) == target; }