I'm trying to compare two strings in JavaScript using endsWith(), like
var isValid = string1.endsWith(string2);
It's working fine in Google Chrome and Mozilla. When comes to IE it's throwing a console error as follows
SCRIPT438: Object doesn't support property or method 'endsWith'
How can I resolve it?