How can I check if a string ends with a particular character in javascript? example I have a string say var str = "mystring#"; I want to know if that string str is ending with "#". How can I check it?
is there a endsWith() method in javascript?
one solution I have is take the length of the string and get the last character and check it.
Is this the best way or there is any other way?